Data Factory > protocol-rest-perform β
This tasks is deprecated
This tasks is deprecated and will be removed in the future. Please use the HTTP Perform task instead.
TL;DR;
This task allows performing one or more HTTP calls to a given web service.
Name:
Max execution time: 120 mins
Target β
Perform one or more HTTP calls to a given web service.
Example of use in a job β
- Send products on a REST API that accepts one product per call and update a status for each product successfully sent.
1. Export Items Export user-selected products
2. XSLT Transformation for soap task
3. REST Calls rest
4. XLST Transformation for item status update
5. Import Items Import items2
3
4
5
Inputs and Outputs β
Example using the BASIC authentication scheme
{
"name": "protocol-rest-perform",
"taskReferenceName": "b",
"description": "The business description of the task",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"endpoint": "https://petstore.swagger.io",
"useAuthentication": true,
"authenticationScheme": "BASIC",
"login": "admin",
"password": "",
"request": "file://assets/request.xml",
"timeout": 30,
"requestInterval" : 0
}
}2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Example using the BEARER authentication scheme
{
"name": "protocol-rest-perform",
"taskReferenceName": "b",
"description": "The business description of the task",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"endpoint": "https://petstore.swagger.io",
"useAuthentication": true,
"authenticationScheme": "BEARER",
"bearer": "token",
"request": "file://assets/request.xml",
"timeout": 30,
"requestInterval" : 0
}
}2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Inputs β
TIP
If at least one task parameters (whether mandatory or not) is invalid, task execution is stopped and the returned status is FAILED. For example:
- The proposed value for the
useAuthenticationproperty is invalid.
| Property | Description |
|---|---|
endpoint | Mandatory - String The target endpoint of the service, along with the http or https protocol |
useAuthentication | Mandatory - Booleantrue: The service requires authentication |
authenticationScheme | Mandatory if useAuthentication = true - Enum - BASIC, BEARER |
login | Mandatory if authenticationScheme = BASIC - StringLogin |
password | Mandatory if authenticationScheme = BASIC - StringPassword |
bearer | Mandatory if authenticationScheme = BEARER β StringThe bearer token |
request | Mandatory - File The request format file defined below |
timeout | Mandatory - Number - Default 0 (aucun timeout) Sets the number of seconds before a request ends in timeout. |
requestInterval | Mandatory - Number - Default 0 (aucun interval) Sets the number of seconds to wait between each request. |
nbRequestAtSameTime | Number - Default 1 Sets the number of requests to execute in parallel. |
Outputs β
TIP
The outputs of the task defined below are always available if the task completes its execution (status COMPLETED and FAILED). If the task is stopped before the end of its execution (if the task is canceled by the user for example - CANCELED status, or if it exceeds the authorized execution time - TIMED_OUT), the outputs are not available.
| Property | Description |
|---|---|
allSuccess | Enum - YES, NOIf all queries returned a 2xx code: YES otherwise NO. |
responses | File The responses produced by the various HTTP calls, see below |
Details on the request document β
<Rest>
<Rest-Call>
<Request method="GET" path="/pet/findByStatus">
<Headers>
<Header key="Date">Wed, 19 Aug 2020 12:16:14 GMT</Header>
<Header key="Transfer-Encoding">chunked</Header>
<Header key="content-type">application/json</Header>
</Headers>
<Parameters>
<Query name="status">available</Query>
</Parameters>
</Request>
<Metadata>
<ean>1234567890123</ean>
</Metadata>
</Rest-Call>
<Rest-Call>
<Request method="POST" path="/pet">
<Headers>
<Header key="Date">Wed, 19 Aug 2020 12:16:14 GMT</Header>
<Header key="Transfer-Encoding">chunked</Header>
<Header key="content-type">application/json</Header>
</Headers>
<Parameters>
<Raw-Body><![CDATA[[{"id":1,"category":{"id":1,"name":"string"},"name":"doggie","photoUrls":["string"],"tags":[{"id":0,"name":"string"}],"status":"available"}]]]></Raw-Body>
</Parameters>
</Request>
<Metadata>
<ean>1234567890123</ean>
</Metadata>
</Rest-Call>
<Rest-Call>
<Request method="POST" path="/pet/1234/uploadImage">
<Headers>
<Header key="Date">Wed, 19 Aug 2020 12:16:14 GMT</Header>
<Header key="Transfer-Encoding">chunked</Header>
<Header key="content-type">application/json</Header>
</Headers>
<Parameters>
<Form-Data name="additionalMetadata" type="TEXT">New meta data</Form-Data>
<Form-Data name="file" type="FILE">https://app.product-live.com/files-data-factory/fb26911d77fe9a9dc44b111eef5b5db7ca2019c8038445662f29b20c54cb6f29</Form-Data>
</Parameters>
</Request>
<Metadata>
<ean>1234567890123</ean>
</Metadata>
</Rest-Call>
</Rest>2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
| XPath | Description | Occurrence |
|---|---|---|
Rest | Root | 1 |
Rest-Call | For each call | 0..* |
Request | The call | 1 |
Request/@method | Enum: GET, POST, PUT, DELETE | 1 |
Request/@path | The path to the api endpoint. Must start with / and contain at least /. | 1 |
Request/Headers | HTTP Headers | 0..1 |
Request/Headers/Header | For each header | 0..* |
Request/Headers/Header/@key | The header key | 1 |
Request/Parameters | Parameters | 0..1 |
Request/Parameters/Query | Query params | 0..* |
Request/Parameters/Query/@name | Query param name | 1 |
Request/Parameters/Raw-Body | Le body | 0..1 |
Request/Parameters/Form-Data | For form-data queries | 0..* |
Request/Parameters/Form-Data/@name | The name of the form-data parameter | 1 |
Request/Parameters/Form-Data/@type | Enum: TEXT, FILE. Si FILE, insert an url | 1 |
Metadata | A tag for storing metadata (see example above) | 0..1 |
Details on the responses document β
The structure is similar to the
requestfile, to which we have attached the responses to each call.
<Rest>
<Rest-Call>
<Request method="GET" path="/pet/findByStatus">
<Headers>
<Header key="Date">Wed, 19 Aug 2020 12:16:14 GMT</Header>
<Header key="Transfer-Encoding">chunked</Header>
<Header key="content-type">application/json</Header>
</Headers>
<Parameters>
<Query name="status">available</Query>
</Parameters>
</Request>
<Metadata>
<ean>1234567890123</ean>
</Metadata>
<Response>
<Status -Code>200</Status-Code>
<Time-Ms>888</Time-Ms>
<Size-Kb>1234</Size-Kb>
<Headers>
<Header key="Date">Mon, 07 Sep 2020 06:15:44 GMT</Header>
<Header key="Content-Type">application/json</Header>
</Headers>
<Body><![CDATA[[{"id":1,"category":{"id":1,"name":"string"},"name":"doggie","photoUrls":["string"],"tags":[{"id":0,"name":"string"}],"status":"available"}]]]></Body>
</Response>
</Rest-Call>
<Rest-Call>
<Request method="POST" path="/pet">
<Headers>
<Header key="Date">Wed, 19 Aug 2020 12:16:14 GMT</Header>
<Header key="Transfer-Encoding">chunked</Header>
<Header key="content-type">application/json</Header>
</Headers>
<Parameters>
<Raw-Body><![CDATA[[{"id":1,"category":{"id":1,"name":"string"},"name":"doggie","photoUrls":["string"],"tags":[{"id":0,"name":"string"}],"status":"available"}]]]></Body>
</Parameters>
</Request>
<Metadata>
<ean>1234567890123</ean>
</Metadata>
<Response>
<Status-Code>200</Status-Code>
<Time-Ms>888</Time-Ms>
<Size-Kb>1234</Size-Kb>
<Headers>
<Header key="Date">Mon, 07 Sep 2020 06:15:44 GMT</Header>
<Header key="Content-Type">application/json</Header>
</Headers>
<Body><![CDATA[[{"id":1,"category":{"id":1,"name":"string"},"name":"doggie","photoUrls":["string"],"tags":[{"id":0,"name":"string"}],"status":"available"}]]]></Body>
</Response>
</Rest-Call>
<Rest-Call>
<Request method="POST" path="/pet/1234/uploadImage">
<Headers>
<Header key="Date">Wed, 19 Aug 2020 12:16:14 GMT</Header>
<Header key="Transfer-Encoding">chunked</Header>
<Header key="content-type">application/json</Header>
</Headers>
<Parameters>
<Form-Data name="additionalMetadata" type="TEXT">New meta data</Form-Data>
<Form-Data name="file" type="FILE">https://app.product-live.com/files-data-factory/fb26911d77fe9a9dc44b111eef5b5db7ca2019c8038445662f29b20c54cb6f29</Form-Data>
</Parameters>
</Request>
<Metadata>
<ean>1234567890123</ean>
</Metadata>
<Response>
<Status-Code>200</Status-Code>
<Time-Ms>888</Time-Ms>
<Size-Kb>1234</Size-Kb>
<Headers>
<Header key="Date">Mon, 07 Sep 2020 06:15:44 GMT</Header>
<Header key="Content-Type">application/json</Header>
</Headers>
<Body><![CDATA[[{"id":1,"category":{"id":1,"name":"string"},"name":"doggie","photoUrls":["string"],"tags":[{"id":0,"name":"string"}],"status":"available"}]]]></Body>
</Response>
</Rest-Call>
</Rest>2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
| XPath | Description | Occurrence |
|---|---|---|
Response | Everything to do with the answer | 1 |
Response/Status-Code | The HTTP code of the response | 1 |
Response/Headers | Response headers | 1 |
Response/Body | The body of the answer | 0..1 |
Known limitations β
- The tool cannot retrieve a file in response to an HTTP call