Patch Space
Request Overview
This packet is sent to make addtions, deletions or changes in a shared space.
Headers
call_type | int |
0 |
packet_type | long |
((100L << 32) |
sequence | long | |
sender_uuid | String | |
connect_back | String | |
space_uuid | String | |
space_ops | JSONArray |
Body
The body of this request is empty.
Custom Objects
Space UUID
The request should include a "space_uuid" object with the UUID of the shared space that the peer is attempting to patch.
{
"space_uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Space Operations
The request should include an array of hashes, with each hash describing one of the patch operations included in this request:
{
"space": {
"ops": [
{
"data": "{\"key\":\"value\"}",
"mimetype": "application/json",
"name": "object_name",
"op": "add/replace/remove",
"path": "/xxxx/xxxx/xxx"
}
}
]
}
Read more about building JSON Patch operations here.
Example
An example of an InvitePeer request:
{
"app_name": "iOS Test App",
"call_type": 0,
"connect_back": "tcp:192.168.0.11:52316",
"packet_type": 429496729602,
"sender_name": "Yaron’s iPhone",
"sender_uuid": "d990088a",
"sequence": 1402688530,
"space": {
"ops": [
{
"data": "{\"color\":\"#000000\"}",
"mimetype": "application/json",
"name": "grid",
"op": "replace",
"path": "/91"
}
}
],
"space_uuid": "f302b8da-4c6d-44e2-a37c-3e5008fed925"
}