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
2
3
4
5
6
7
8
9
10
{
"serviceType": "avid.acs.calculator",
"serviceRealm": "global.test",
"serviceVersion": 3,
"op": "add",
"paramSet": {
"num1": 5,
"num2": 3
}
}

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, service message object has following 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 object additional context parameters to be passed in the request to the service operation false n/a
1
2
3
4
5
6
7
8
9
10
11
12
{
"serviceType": "avid.acs.calculator",
"serviceRealm": "global.test",
"serviceVersion": 3,
"op": "addInContext",
"context": {
"add": {
"num1": 2,
"num2": 4
}
}
}

Request message context have special object "sender", which is populated automatically by Secure Gateway with the following data:

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
{
"sender": {
"access": {
"id": "8dbb4278-1204-4686-92cd-e373cba728d3",
"gateway": {
"id": "7b8eb0e5-738a-40f5-8515-6b5bf308db9d",
"bal": "java 3.7.2.25_g2cc0a90-SNAPSHOT",
"host": "acs-zone-black",
"pid": 4624,
"platformId": "black",
"buildNumber": "3.7.2_25_g2cc0a90-1.x86_64",
"environmentId": "black"
},
"service": {
"id": "94662691-c1fa-4a5b-9a20-919cb0d5e427",
"bal": "node.js 3.7.2",
"host": "acs-zone-black",
"pid": 5549,
"platformId": "black",
"buildNumber": "3.5.3_2_g70b0518-1.x86_64",
"environmentId": "black"
}
}
}
}

Response

In general response message from the service has following 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
errorSet array array of error(s) if any occurred false n/a
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
{
"serviceType": "avid.acs.calculator",
"serviceRealm": "global.test",
"serviceVersion": 3,
"op": "divide",
"context": {
"sender": {
"access": {
"id": "8dbb4278-1204-4686-92cd-e373cba728d3",
"bal": "java 3.7.2.25_g2cc0a90-SNAPSHOT",
"host": "acs-zone-black",
"pid": 4624,
"platformId": "black",
"buildNumber": "3.7.2_25_g2cc0a90-1.x86_64",
"proxyBal": "node.js 3.7.2",
"gateway": {
"id": "7b8eb0e5-738a-40f5-8515-6b5bf308db9d",
"bal": "java 3.7.2.25_g2cc0a90-SNAPSHOT",
"host": "acs-zone-black",
"pid": 4624,
"platformId": "black",
"buildNumber": "3.7.2_25_g2cc0a90-1.x86_64",
"environmentId": "black"
},
"service": {
"id": "94662691-c1fa-4a5b-9a20-919cb0d5e427",
"bal": "node.js 3.7.2",
"host": "acs-zone-black",
"pid": 5549,
"platformId": "black",
"buildNumber": "3.5.3_2_g70b0518-1.x86_64",
"environmentId": "black"
}
},
"transaction": {
"id": "53c47c4e-6cc9-41dd-b805-410ebe691d22",
"origin": "gateway"
}
}
},
"resultSet": {
"quotient": 4
}
}
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
{
"serviceType": "avid.acs.calculator",
"serviceRealm": "global.test",
"serviceVersion": 3,
"op": "addInContext",
"context": {
"sender": {
"access": {
"id": "8dbb4278-1204-4686-92cd-e373cba728d3",
"bal": "java 3.7.2.25_g2cc0a90-SNAPSHOT",
"host": "acs-zone-black",
"pid": 4624,
"platformId": "black",
"buildNumber": "3.7.2_25_g2cc0a90-1.x86_64",
"proxyBal": "node.js 3.7.2",
"gateway": {
"id": "7b8eb0e5-738a-40f5-8515-6b5bf308db9d",
"bal": "java 3.7.2.25_g2cc0a90-SNAPSHOT",
"host": "acs-zone-black",
"pid": 4624,
"platformId": "black",
"buildNumber": "3.7.2_25_g2cc0a90-1.x86_64",
"environmentId": "black"
},
"service": {
"id": "94662691-c1fa-4a5b-9a20-919cb0d5e427",
"bal": "node.js 3.7.2",
"host": "acs-zone-black",
"pid": 5549,
"platformId": "black",
"buildNumber": "3.5.3_2_g70b0518-1.x86_64",
"environmentId": "black"
}
},
"transaction": {
"id": "51e1c7ce-84e1-4d8a-bb27-4cc9d86588e7",
"origin": "gateway"
}
}
},
"errorSet": [
{
"code": "avid.acs/I0002",
"details": "Cannot read property 'num1' of undefined",
"message": "Internal service error",
"incident": "f284ae42-1b60-48db-b587-fe0971169bad",
"severity": "ERROR",
"status": 500,
"origin": {
"type": "avid.acs.calculator",
"realm": "global.test",
"version": 3
}
}
]
}