Need sample workflow definition for HTTP POST Request (which has request payload as json data) #175
-
Need sample workflow definition for HTTP POST Request (which has request payload as json data) {
"expressionLang": "jq",
"functions": [
{
"name": "FeatureapiFeaturePOST",
"operation": "http://*.*.*.*:80/swagger/v1/swagger.json#FeatureapiFeatureSave",
"type": "rest",
"authRef": "bearer_token"
}
],
"auth": [
{
"scheme": "bearer",
"properties": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJFbXBsb3llZUlEIjoiMTAwMDI1OTYxNyIsIlVzZXJOYW1lIjoiS2FydGhhbiBWaWpheSIsIkVtYWlsIjoiS2FydGhhbi5WaWpheUB3ZGMuY29tIiwiZXhwIjoxNjYwNjQ4MDI2LCJpc3MiOiJDb25maWcgRWNvc3lzdGVtIiwiYXVkIjoiQ29uZmlnIEVjb3N5c3RlbSJ9.XVv8WMwDblsVN8cmlSOPiMC5dmTZX00EP28nvNFH49s"
},
"name": "bearer_token"
}
],
"id": "AuthTokenPostSampleRequest",
"name": "Test",
"version": "1.0.5",
"specVersion": "0.8",
"keepActive": false,
"states": [
{
"end": true,
"actionMode": "sequential",
"type": "operation",
"actions": [
{
"functionRef": {
"refName": "FeatureapiFeaturePOST",
"arguments": {
"inputData": "${. }"
}
},
"name": "OpenAPI"
}
],
"name": "CofigSettings",
"usedForCompensation": false
}
],
"autoRetries": false
} |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
If you want to use the workflow's input as argument for a POST, you can use {
"expressionLang":"jq",
"functions":[
{
"name":"AddPetFn",
"operation":"https://petstore.swagger.io/v2/swagger.json/#addPet",
"type":"rest"
}
],
"id":"addpet",
"name":"Add Pet",
"version":"1.0.0",
"specVersion":"0.8",
"keepActive":false,
"states":[
{
"name":"AddPet",
"end":true,
"type":"operation",
"actions":[
{
"name":"addpetaction",
"functionRef":{
"refName":"AddPetFn",
"arguments":{
"body":"${. }"
}
}
}
]
}
]
} |
Beta Was this translation helpful? Give feedback.
-
Hi @karthanvijay!
No, you don't. Your issue might then be related to #179, which I coincidentally ran into last week. It has been fixed in release 0.1.15.
Defining it in the workflow allows for transparent use of your token, which will be added to both the At the moment, there's no "out-of-the-box" way to add parameters that are not explicitely defined by the If you want to pass your token to a
No, that is a bug I created #192 for. It will be fixed by tomorrow.
This is normal, though there's no way you could know about it, as the SW spec doesn't enforce some of Synapse's rules. In this case, it is because Synapse expects all conditions to be named, which is anyways a good practice as the workflow's representation becomes more ubiquitous. By the way, in SW I hope this answer your questions ;) |
Beta Was this translation helpful? Give feedback.
-
@karthanvijay Btw, don't hesitate to drop a star to show support to the project 😉 |
Beta Was this translation helpful? Give feedback.
If you want to use the workflow's input as argument for a POST, you can use
body
. Here is a petstore sample: