Author Message
EnriqueClaudioRodriguez
Joined: Oct 6, 2016
Messages: 3
Offline
This is Avaya Engagement Designer Version 3.2.0.1

I'm attempting to call a REST service using Integration->Call REST service block
as per documentation the 'Input Schema' is loaded automatically (using the retrieve button), however the 'Return Schema' needs to be provided in order to obtain the 'Output Schema'

my problem is defining the 'return schema' - tried several cobinations but still getting errors about properties not defined and such

What will be the correct 'return schema' for the following json 'response' object?


*************************************************
{
"actionType": "action type value",
"workId": "456478",
"stateReason": "Queued",
"resourceResponseMap": {},
"serviceResponseMap": {
"1": {
"attributes": {
"Channel": [
"paper"
],
"CategoryID1": [
"subCat1"
]
},
"resourceList": [],
"metrics": {
"ResourceReadyCount": "0",
"ResourceBusyCount": "0",
"ProcessingWorkCount": "0",
"CompletedWorkCount": "0",
"EWT": "180.0",
"WaitingWorkCount": "0",
"OldestWorkWaiting": "0",
"RollingASA": "0.0",
"ResourceStaffedCount": "2",
"ServiceOccupancy": "0.0"
}
}
},
"workRequestId": "22234"
}

******************************************************


This is a section of the WA Developers guide around the Call REST Services


Payload (mandatory) – The data being sent to the website. The parameter in payloads is in the
curly bracket {}. Its name should contain only alphanumeric characters. For example,
{"email":"{payloadParam1}", "user":"{payloadParam2}"}

• Input schema (mandatory) – Click Retrieve to generate the input schema of the Call Rest task
based on the input in the Rest URI, Customized Headers and Payload fields. The schema is
based on the input from these fields and is not based on anything retrieved remotely. Click the
Show checkbox to view the generated input schema. The input schema allows you to do input
mapping.

• Return schema (mandatory) – The schema of the JSON payload returned by the external
REST service. It should be empty if the Content Type in the HTTP response is not “application/
json.”
Populate the Return schema for the JSON payload in the response you are expecting from
the external REST service so that you can map each property in the JSON payload separately
and pass them individually to the next task. For example,
{title:JSONPayloadSchema,type:object,properties:{authenticated:
{type:string},user:{type:string}}}.


• Output schema (mandatory) – Click Retrieve to generate the output schema of this Call Rest
task. Click the Show checkbox to view the generated output schema. The output schema
allows you to do output mapping.





DaraGeary
Joined: Mar 28, 2017
Messages: 5
Offline
The schema is the same as the WORK_OFFER event in the SMGR event catalog (chop off the additional unnecessary services if there’s only going to be a single service used, and maybe dropping the description).

HOWEVER, you shouldn't really be using the REST task at all in this case as the Request Resource API to Work Assignment Engine is asynchronous, so even if the task works, all you will get back is 202.

You should really be using the WA RR task - as part of the Work Assignment task bundle; there is a pre-built workflow that shows you how to use this task and how to handle the async response.

Go to:   
Mobile view