JoinAccept

Response Overview

This packet is sent to accept a peer's request to join a space.

Headers

call_type int 1
packet_type long ((101L << 32)
sequence long Should match JoinSpace request sequence
sender_uuid String
connect_back String
space_uuid String
space_members JSONArray
space_ops JSONArray

Body

The body of this request is empty.

Custom Objects

Space UUID

The response should include a "space_uuid" object with the UUID of the shared space that the peer has accepted to join.

{
    "space_uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Space Members

This request should include a "space_members" object describing the current owners and members of the shared space.

{
    "space": {
        "members": {
            "members": [
                {
                    "member_uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
                    "status": "invited/joined/disconnected"
                }
            ],
            "owners": [
                {
                    "member_uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
                    "status": "invited/joined/disconnected"
                }
            ]
        }
    }
}

###Space Operations
As part of of the JoinAccept request, a set of operations describing the entire or part of the existing space can be added.

```json
{
    "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": 1,
    "connect_back": "tcp:172.16.20.133:64443",
    "packet_type": 433791696900,
    "sender_name": "iPhone Simulator",
    "sender_uuid": "d6f2eb53",
    "sequence": 1402245117,
    "space_uuid": "40071168-0836-4560-a022-cb7a315b1855",
    "space": {
        "members": {
            "members": [
                {
                    "member_uuid": "c4a3dc21",
                    "status": "joined"
                }
            ],
            "owners": [
                {
                    "member_uuid": "d6f2eb53",
                    "status": "joined"
                }
            ]
        },
        "ops": [
            {
                "data": "{\"color\":\"#000000\"}",
                "mimetype": "application/json",
                "name": "grid",
                "op": "replace",
                "path": "/91"
            }
        ]
    }
}