Service Message
To communicate with Avid Platform services, sender must be able to
compose valid request message and read corresponding response. Request
and response messages are using JSON format.
Request
To send request to Avid Platform service, caller must know type, version
and realm of the target service. Also caller must know parameters of the
request message. Here is example of the request to the service:
1 | { |
In the given example request will go to the service having type
“avid.acs.calculator” of version 3, having realm “global.test”.
Operation to be invoked on this service is “add”. Parameters to be
passed to this operations are “num1”=5 and “num2”=3.
In general, request message has two pieces:
- message itself;
- context;
Message is JSON object. In future releases content type will be designed to allow any message type.
JSON message has following mandatory fields:
Field Name | Type | Description | Is Required | Default |
---|---|---|---|---|
serviceType | string | name of the target service | true | n/a |
serviceRealm | string | realm of the target service | true | n/a |
serviceVersion | integer | version of the target service | true | n/a |
op | string | name of the operation to be invoked | true | n/a |
paramSet | object | parameters to be passed in the request to operation | false | n/a |
Context is JSON Object with parameters to be passed in the request to the service operation.
Message example:
1 | { |
Context example
1 | { |
Request message context have special object “sender”, which is populated
automatically by Secure Gateway with the following data:
1 | { |
Response
In general response message has three pieces:
- response message itself;
- context;
- error set;
Response message is JSON object. In future releases content type will be designed to allow any message type.
JSON response message has following mandatory fields:
Field Name | Type | Description | Is Required | Default |
---|---|---|---|---|
serviceType | string | name of the service which provided response | true | n/a |
serviceRealm | string | realm of the service which provided response | true | n/a |
serviceVersion | string | version of the service which provided response | true | n/a |
resultSet | object | response object from the service | false | n/a |
Error set is JSON array with structured errors returned as a result of service operation execution
Context is JSON Object with parameters
Response message example:
1 | { |
Context example:
1 | { |
Error set example:
1 | [ |