Create request
Add a new request and optionally start processing it.
A process will only be started if the ACTION and FLOW parameters are filled in.
POST /connectr/api/units/{unit}/requests
Example Request URL: http://connectr.example.org:8080/connectr/api/units/4.1/requests
Template parameter | Value | Description |
---|---|---|
unit (Mandatory) | String | Unit code as used in Data Manager. This is currently defined in the Publish Store settings. |
Request entity | Content type | Description |
---|---|---|
Request XML | String | A generation request XML. See appendix “XML Schema for Generation Request” for the format. |
Response status code | Content type | Description |
---|---|---|
200 OK | application/xml | Request created successfully. See below for the format. |
400 Bad request | text/plain | The XML is not well-formed, the METADATA fields might be incorrect or the file could not be saved. The response entity has more details. |
404 Not found | text/plain | The unit could not be found. |
Response format
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0">
<xs:element name="RequestInfo" type="RequestInfoResponse"/>
<xs:complexType name="RequestInfoResponse">
<xs:sequence>
<xs:element name="ext" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:any processContents="lax" namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="requestGuid" type="xs:string"/>
<xs:element name="processStarted" type="xs:boolean"/>
<xs:element name="creationDate" type="xs:dateTime"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
Example
Suppose we send the following request body:
<LETTERGEN>
<METADATA>
<REQID>Test_Template_7.3</REQID>
<GUID/>
<!-- Following fields are necessary for ConnectR. -->
<STAGE>4</STAGE>
<UNIT>4.1</UNIT>
<FLOW>PDF</FLOW>
<MODEL>Template_7.3_3.3.0</MODEL>
<LANGUAGE>en-US</LANGUAGE>
<ACTION>GENERATE</ACTION>
<DESCRIPTION>Test_Template_7.3</DESCRIPTION>
<!-- Must be true for a package generation. -->
<ISPACKAGE>true</ISPACKAGE>
<ISBATCH>false</ISBATCH>
</METADATA>
<DATA>
<Connective>
<L_Datablock_A>
<Repeating_DB_A>Repeat 1</Repeating_DB_A>
<Repeating_DB_A>Repeat 2</Repeating_DB_A>
<Repeating_DB_A>Repeat 3</Repeating_DB_A>
</L_Datablock_A>
<Datablock_B>
<StringField>StringField</StringField>
<DateTimeField>2001-12-31T12:00:00</DateTimeField>
<DateField>2014-10-01</DateField>
<NumberField1>0.0</NumberField1>
<NumberField2>0.0</NumberField2>
<NumberField3>0.0</NumberField3>
<NumberField4>0.0</NumberField4>
<BooleanField1>1</BooleanField1>
<BooleanField2>true</BooleanField2>
<IntegerField>0</IntegerField>
<DoubleField>0.0</DoubleField>
</Datablock_B>
</Connective>
</DATA>
</LETTERGEN>
What a potential response might look like if the response status is 200 OK:
<RequestInfo>
<ext/>
<requestGuid>5037a3b5-7ec5-4281-89a7-1b352c9bfb95</requestGuid>
<processStarted>true</processStarted>
<creationDate>2015-10-22T14:21:40.495Z</creationDate>
</RequestInfo>