Skip to content

Instantly share code, notes, and snippets.

@scarabaeus
Last active July 21, 2022 16:32
Show Gist options
  • Save scarabaeus/fbae822c362bf7a2c1267c2d12b478fd to your computer and use it in GitHub Desktop.
Save scarabaeus/fbae822c362bf7a2c1267c2d12b478fd to your computer and use it in GitHub Desktop.
Example Service Task Configuration
// https://try.jsonata.org/g-X7ev7nl
// Sample Input ----------------------------
{
"claim_id": 9876543212,
"policy_type": "AUTO",
"auth_token": "ABCDEF"
}
// Schema ----------------------------------
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"claim_id": {
"type": "integer"
},
"claimant_first_name": {
"type": "string"
},
"claimant_last_name": {
"type": "string"
},
"weather_conditions": {
"type": "string"
},
"Steve": {
"type": "string"
}
},
"required": [
"claim_id",
"claimant_first_name",
"claimant_last_name",
"weather_conditions",
"Steve"
]
}
// Expression ------------------------------
{
"method": "POST",
"url": "http://myapi.com/dev",
"headers": {
"Auth-Token": $.auth_token
},
"params": {
},
"data": {
"claimant": {
"claimId": $.claim_id
},
"policy": {
"policyType": $.policy_type
}
}
}
// Sample Output ---------------------------
{
"method": "POST",
"url": "http://myapi.com/dev",
"headers": {
"Auth-Token": "ABCDEF"
},
"params": {},
"data": {
"claimant": {
"claimId": 9876543212
},
"policy": {
"policyType": "AUTO"
}
}
}
@scarabaeus
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment