Rest
Allows to perform REST calls on a REST API.
Json
Example
json
{
"name": "protocol-rest-perform",
"taskReferenceName": "rest",
"description": "The business description of the task",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"endpoint": "https://",
"useAuthentication": true,
"authenticationScheme": "BASIC",
"login": "admin",
"password": "",
"request": "file://assets/request.xml"
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
json
{
"name": "protocol-rest-perform",
"taskReferenceName": "rest",
"description": "The business description of the task",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"endpoint": "https://",
"useAuthentication": true,
"authenticationScheme": "BEARER",
"bearer": "",
"request": "file://assets/request.xml"
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
Definition
Property | Type | Required | Description |
---|---|---|---|
The name (or type) of the task | |||
The unique name of the task in your job. It is used to reference this task in the workflow. | |||
The functional description of this task in your job. | |||
The type of the task. It must be SUB_WORKFLOW . | |||
true : the job continues if there is an error on this task. false : the job fails. | |||
Input parameters of the task. See below |
Inputs
Property | Description |
---|---|
endpoint | The endpoint. |
useAuthentication | Does it need authentication? true |
authenticationScheme | BASIC | BEARER . |
bearer | The token |
login | Login |
password | Password |
request | A valid input. A file that defines all the requests. See the definition below. |
timeout | Number of seconds before a request is considered in timeout. |
requestInterval | Number of seconds between each requests. |
Input request
Example
xml
<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[[The content must be encapsulated in CDATA]]]></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>
1
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
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
Definition
You can do multiple calls with only one xml file.
XPath | Description | Occurs |
---|---|---|
Rest | Root of the document | 1 |
./Rest-Call | For each call. | 1..* |
../Request | The request element | 1 |
../Request/@method | The method GET | POST ... | 1 |
../Request/@path | The path containing path params. | 1 |
../Request/Headers | The headers. | 0..1 |
.../Headers/Header | A header | 1..* |
.../Headers/Header@key | The name of the header | 1 |
../Request/Parameters | The parameters. It can be Raw-Body | Form-Data | Query , see examples. | 0..1 |
../Metadata | An element that can be used to store informations and retrieve them in the responses. | 0..1 |
Outputs
Property | Type | Description |
---|---|---|
responses | An xml file containing the responses for each request. | |
file | If the request generates a file | |
files | If the requests generate multiple files | |
allSuccess | YES | NO . YES : all calls had a success response. NO : at least one request had an error response. |
Output responses
Example
xml
<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>
1
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
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
Definition
The response has the structure as the request with some elements added.
XPath | Description | Occurs |
---|---|---|
./Response | The response for each call. | 1 |
../Status-Code | The status code of the response | 1 |
../Time-Ms | Response time in ms. | 1 |
../Size-Kb | Response size in kb. | 1 |
../Headers | Response headers. | 1 |
../Body | Response body. | 1 |
../Content | The content of the response | 1 |
Limits and additional notes
- 50 requests in a file.