Resources

This specification is a work in progress and is subject to change without notice.

Every connected node on a LIME network has its own set of resources that can be queried or changed by another nodes through commands, if they have the permissions for that. Besides that, the domain servers can store resources for the domain identities, providing services like account and contact management.

This page suggests some common resource types that can be available in some the protocol implementations, but they are not part of the core specification.

Account

Represents an user account information.

URI template

    lime://{ownerIdentity}/account

MIME type

    application/vnd.lime.account+json

JSON schema


{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "account",
    "type": "object",
    "properties": {
        "fullName": {
            "type": "string"
        },
        "address": {
            "type": "string"
        },
        "city": {
            "type": "string"
        },
        "email": {
            "type": "string"
        },
        "phoneNumber": {
            "type": "string"
        },
        "photoUri": {
            "type": "string",
            "format": "uri"
        },
        "cellPhoneNumber": {
            "type": "string"
        },
        "gender": {
            "type": "string"
        },
        "timezone": {
            "type": "integer"
        },
        "culture": {
            "type": "string"
        },        
        "extras": {
            "type": "object"
        },        
        "isTemporary": {
            "type": "boolean"
        },
        "password": {
            "type": "string"
        },
        "oldPassword": {
            "type": "string"
        },
        "inboxSize": {
            "type": "integer",
            "minimum": 0
        },
        "allowGuestSender": {
            "type": "boolean"
        },   
        "allowUnknownSender": {
            "type": "boolean"
        },   
        "storeMessageContent": {
            "type": "boolean"
        },   
        "encryptMessageContent": {
            "type": "boolean"
        }
    }
}

Properties

  • fullName - The user full name.
  • address - The user address.
  • city - The user city name.
  • email - The user e-mail address.
  • phoneNumber - The user phone number.
  • photoUri - The user photo URI.
  • cellPhoneNumber - The user cellphone number.
  • gender - The user gender (male/female).
  • timezone - The user timezone relative to GMT.
  • culture - The user culture info, in the IETF language tag format.
  • extras - A generic JSON property to store any key/value strings.
  • isTemporary - Indicates that the account is temporary is valid only in the current session. The default value is false.
  • password - Base64 representation of the account password. Only valid on set commands during the account creation or update.
  • oldPassword - Base64 representation of the account password. Only valid on set commands during the account password update.
  • inboxSize - Size of account inbox for storing offline messages. The default value is 0.
  • allowGuestSender - Indicates if this account allows receive messages from users with guest sessions.
  • allowUnknownSender - Indicates if this account allows receive messages from users that are not in the account contact list.
  • storeMessageContent - Indicates if the content of messages from this account should be stored in the server. Note that for offline messages, this will always happens.
  • encryptMessageContent - Indicates if the content of messages from this account should be encrypted in the server.

Example

Setting the account information:

C:

{
    "id": "f6b9160c-7539-4369-aa1d-c3b51380a524",
    "from": "saul@breakingbad.com/office",
    "method": "set",
    "uri": "/account",
    "type": "application/vnd.lime.account+json",
    "resource": {
        "fullName": "Saul McGill Goodman",
        "phoneNumber": "+15055034455",
        "city": "Albuquerque",
        "password": "a2V2aW5jb3N0bmVy",
        "allowGuestSender": false
    }        
}

S:

{
    "id": "f6b9160c-7539-4369-aa1d-c3b51380a524",
    "to": "saul@breakingbad.com/office",
    "method": "set",
    "status": "success"
}


Capability

Represents the messaging capabilities of a node in a session.

URI template

    lime://{ownerIdentity}/capability

MIME type

    application/vnd.lime.capability+json

JSON Schema


{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "capability",
    "type": "object",
    "properties": {
        "contentTypes": {
            "type": "array",
            "items": { 
                "type": "string",
                "pattern": "^[-\w]+/[-\w.]+(\+json)$"
            }
        },
        "resourceTypes": {
            "type": "array",
            "items": { 
                "type": "string",
                "pattern": "^[-\w]+/[-\w.]+(\+json)$"
            }
        },
    }
}

Properties

  • contentTypes - Indicates the message content types that the session node is able to handle. By default, the server delivers all messages types to the nodes.
  • resourceTypes - Indicates the command resource types that the session node is able to handle. By default, the server blocks all command addressed to the nodes.

Example

Get the current session capabilities:


C:
{
    "id": "d1ad793d-2bf2-42f2-a843-65c7b518e601",
    "from": "walterjr@breakingbad.com/home",
    "method": "get",
    "uri": "/capability"
}


S:
{
    "id": "d1ad793d-2bf2-42f2-a843-65c7b518e601",    
    "from": "server@breakingbad.com/machine1",
    "to": "walterjr@breakingbad.com/home",
    "method": "get",
    "result": "success",
    "type": "application/vnd.lime.capability+json",
    "resource": {
        "contentTypes": [
            "application/vnd.lime.text+json",
            "application/vnd.lime.chatstate+json",
        ],
        "resourceTypes": [
            "application/vnd.lime.ping+json"
        ]
    }
}


Receipt

Represents the events that the client wants to receive.

URI template

    lime://{ownerIdentity}/receipt

MIME type

     application/vnd.lime.receipt+json

JSON Schema


{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "receipt",
    "type": "object",
    "properties": {
        "events" : {
            "enum": [ 
                "failed",
                "accepted",
                "validated",
                "authorized",
                "dispatched",
                "received",
                "consumed"
            ]
        },
    }
}

Properties

  • events - Indicates the events that you want the server to send info about. By default, the server will notificate only failed events.

Example

Set to accept all events:


C:
{
    "id":  "2f158480-8c4e-4987-94e5-e4b960622f4b",
    "method":  "set",
    "from": "walterjr@breakingbad.com/home",
    "uri": "/receipt",
    "type":  "application/vnd.lime.receipt+json",
    "resource":  {
        "events":  [
            "failed",
            "accepted",
            "validated",
            "authorized",
            "dispatched",
            "received",
            "consumed"    
    ]  
  }
}


S:
{
    "method": "set",
    "status": "success",
    "id": "2f158480-8c4e-4987-94e5-e4b960622f4b",
    "from": "server@breakingbad.com/machine1",
    "to": "walterjr@breakingbad.com/home"
}


Delegation

Represents a delegation to send envelopes on behalf of another identity of the same network. The delegation can be constrained to specific envelope types. It can be revoked through a delete command.

In some cases, the delegation is issued automatically by the server. For instance if a node adds an identity to his roster, a node with this identity can get the presence resource on his behalf in the server.

URI template

    lime://{ownerIdentity}/delegations

MIME type

    application/vnd.lime.delegation+json

JSON Schema


{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "delegation",
    "type": "object",
    "properties": {
        "target": {
            "type": "string",
            "pattern": "^(?:([^\"&'/:<>@@]{1,1023})@@)?([^/@@]{1,1023})(?:/(.{1,1023}))?$"
        },
        "envelopeTypes": {
            "type": "array",
            "items": {                 
                "enum": [ 
                    "message",
                    "notification",
                    "command"
                ]
            }
        },
        "messages": {
            "type": "array",
            "items": { 
                "type": "string"
            }
        },
        "notifications": {
            "type": "array",
            "items": { 
                "enum": [ 
                    "received",
                    "consumed",
                    "failed"
                ]
            }
        },
        "commands": {
            "type": "array",
            "items": { 
                "method" : {
                    "enum": [ 
                        "get",
                        "set",
                        "delete",
                        "observe"
                    ]
                },
                "uri" : {
                    "title": "limeUri",
                    "type": "string",
                    "pattern": "^((lime://)(\w\.?-?)+@@?(\w\.?-?@@?)+)?(/(\w\.?-?@@?)+)+(\?{1}((\w+=\w+)&?)+)?$"
                },
                "status": {
                    "enum": [
                        "success",
                        "failure"
                    ]
                }
            }
        },
           
    },
    "required" : [ "target" ]
}

Properties

  • target - The target node which will receive the delegation.
  • envelopeTypes - The envelope types for delegation. If none is specified, indicates that all envelope types should be delegated.
  • messages - Message constraints for delegation. If not present, the delegation is given without any restriction for the message envelope type. Each item in the array define the following properties:
    • type - The MIME type of the content type for delegation.
  • notifications - Notification constraints for delegation. If not present, the delegation is given without any restriction for the notification envelope type. Each item in the array define the following properties:
    • event - The event type for delegation.
  • commands - Command constraints for delegation. If not present, the delegation is given without any restriction for the command envelope type. Each item in the array define the following properties:
    • method - The method for delegation. If not present, The delegation is given for any method in the specified URI.
    • uri - The resource URI fo delegation.
    • status - The comand status for delegation. If not present, The delegation is given for any status in the specified URI.

Example

1 - The delegate begins the process sending a delegate request to the issuer:

{
    "id": "e33e1659-b98f-4822-ba3d-e4a23f346907",
    "from": "saul@breakingbad.com/office",
    "to": "heisenberg@breakingbad.com",
    "method": "get",
    "uri": "/delegations",
    "type": "application/vnd.lime.delegation+json",
    "resource": {
        "destinations" : [
            "jesse@breakingbad.com",
            "guywhoknowsaguy@breakingbad.com",
        ],
        "commands": [
            { 
                "type": "application/vnd.lime.presence+json",
                "methods": [ "get" ]
            },
            { 
                "type": "application/vnd.lime.account+json",
                "methods": [ "get", "set" ]
            }
        ],
        "messages": [
            "application/vnd.lime.text+json"
        ]
    }
}

2 - The issuer sends a set command to the server:

{
    "id": "e5a071c5-11f1-49e6-bcac-f2595876a8a2",
    "from": "heisenberg@breakingbad.com/home",
    "method": "set",
    "type": "application/vnd.lime.delegation+json",
    "resource": {
        "target": "saul@breakingbad.com/office",
        "destinations" : [
            "jesse@breakingbad.com",
            "guywhoknowsaguy@breakingbad.com",
        ],
        "commands": [
            { 
                "type": "application/vnd.lime.presence+json",
                "methods": [ "get" ]
            },
            { 
                "type": "application/vnd.lime.account+json",
                "methods": [ "get", "set" ]
            }
        ],
        "messages": [
            "application/vnd.lime.text+json"
        ]
    }
}

3 - The server acknowledges:    

{
    "id": "e5a071c5-11f1-49e6-bcac-f2595876a8a2",
    "to": "heisenberg@breakingbad.com/home",
    "method": "set",
    "type": "application/vnd.lime.delegation+json",
    "result": "success"    
}

4 - The issuer acknowledges:

{
    "id": "e33e1659-b98f-4822-ba3d-e4a23f346907",
    "from": "heisenberg@breakingbad.com/home",
    "to": "saul@breakingbad.com/office",
    "method": "get",
    "type": "application/vnd.lime.delegation+json",
    "resource": {
        "destinations" : [
            "jesse@breakingbad.com",
            "guywhoknowsaguy@breakingbad.com",
        ],
        "commands": [
            { 
                "type": "application/vnd.lime.presence+json",
                "methods": [ "get" ]
            },
            { 
                "type": "application/vnd.lime.account+json",
                "methods": [ "get", "set" ]
            }
        ],
        "messages": [
            "application/vnd.lime.text+json"
        ]
    }
}

5 - The delegate sends a message on behalf of the issuer:

{
    "from": "heisenberg@breakingbad.com",
    "pp": "saul@breakingbad.com/office",
    "to": "jesse@breakingbad.com",
    "type": "application/vnd.lime.text+json",
    "content": {
        "text": "Let's meet at the office."
    }
}


Group

Allows the nodes to manage the groups that they owns or participates.

URI templates

    lime://{ownerIdentity}/groups
    lime://{ownerIdentity}/groups/{groupIdentity}

MIME type

    application/vnd.lime.group+json

JSON Schema


{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "group",
    "type": "object",
    "properties": {
        "groups" : {
            "title": "group",
            "type": "object",
            "properties": {
                "identity": {
                    "title": "identity",
                    "type": "string",
                    "pattern": "^(?:([^\"&'/:<>@@]{1,1023})@@)?([^/@@]{1,1023})$"
                },
                "name" : {
                    "type": "string"
                },
                "photoUri": {
                    "type": "string",
                    "format": "uri"
                },
                "creator": {
                    "title": "identity",
                    "type": "string",
                    "pattern": "^(?:([^\"&'/:<>@@]{1,1023})@@)?([^/@@]{1,1023})$"
                },
                "created": {
                    "type": "string",
                    "format": "date-time"
                },
                "type" : {
                    "enum": [ "temporary", "public", "private" ]
                },
                "members" : {
                    "title": "limeUri",
                    "type": "string",
                    "pattern": "^((lime://)(\w\.?-?)+@@?(\w\.?-?@@?)+)?(/(\w\.?-?@@?)+)+(\?{1}((\w+=\w+)&?)+)?$"
                }
            },
            "required" : [ "identity" ]
        }
    }
}

Properties

  • groups - List of groups that the node owns or participates. Every group can have the following properties:
    • identity - Identity of the group, in the group-id@groups.domain.com format. The groups subdomain is needed because that's the name of the application that handle the group messaging.
    • name - Name of the group.
    • photoUri - Photo URI of the group.
    • creator - Identity of the creator of the group.
    • created - Date and time of creation of the group.
    • type - Type of the group. The possible values are:
      • temporary - The group exists while the owner session that created it is active. This type of group is useful for mass message sending, since the groups application is optimized to send large amounts of messages. The temporary groups are private.
      • private - The group is not discoverable and someone can join only if is invited by owner or a moderator.
      • public - Any authenticated node in the domain can join the group.
    • members - The URI to the group members resource.

Examples

Getting all groups:

C:

{
    "id": "2aac8738-5507-44bf-b85a-30e146250fa3",
    "from": "gus@breakingbad.com/pollos",
    "method": "get",    
    "uri": "/groups"
}

S:

{
    "id": "2aac8738-5507-44bf-b85a-30e146250fa3",
    "from": "server@breakingbad.com/machine1",
    "to": "gus@breakingbad.com/pollos",
    "method": "get",
    "result": "success",
    "type": "application/vnd.lime.collection+json",
    "resource": {
        "total": 3,
        "itemType": "application/vnd.lime.group+json",
        "items": [
            {
                "identity": "methcookers@groups.breakingbad.com",
                "name": "Meth cookers",
                "type": "private",
                "members": "/groups/methcookers@groups.breakingbad.com/members"
            },
            {
                "identity": "pollos@groups.breakingbad.com",
                "name": "Los Pollos Hermanos Staff",
                "type": "public",
                "members": "/groups/pollos@groups.breakingbad.com/members"
            },
            {
                "identity": "police@groups.breakingbad.com",
                "name": "Albuquerque Police Department officers and supporters",
                "type": "public",
                "members": "/groups/police@groups.breakingbad.com/members"
            }
        ]
    }
}

Getting specific group:

C:

{
    "id": "2aac8738-5507-44bf-b85a-30e146250fa3",
    "from": "gus@breakingbad.com/pollos",
    "method": "get",    
    "uri": "/groups/pollos@groups.breakingbad.com"
}

S:

{
    "id": "2aac8738-5507-44bf-b85a-30e146250fa3",
    "from": "server@breakingbad.com/machine1",
    "to": "gus@breakingbad.com/pollos",
    "method": "get",
    "result": "success",
    "type": "application/vnd.lime.group+json",
    "resource": {
        "identity": "pollos@groups.breakingbad.com",
        "name": "Los Pollos Hermanos Staff",
        "type": "public",
        "members": "/groups/pollos@groups.breakingbad.com/members"
    }
}


Member

Allows the nodes to manage the members of the groups that they owns or participates.

URI templates

    lime://{ownerIdentity}/groups/{groupIdentity}/members
    lime://{ownerIdentity}/groups/{groupIdentity}/members/{memberIdentity}
    lime://{ownerIdentity}/groups/{groupIdentity}/members/{memberIdentity}/{memberInstance}

MIME type

    application/vnd.lime.group+json

JSON Schema


{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "member",
    "type": "object",
    "properties": {
        "identity": {
            "title": "address",
            "type": "string",
            "pattern": "^(?:([^\"&'/:<>@@]{1,1023})@@)?([^/@@]{1,1023})(?:/(.{1,1023}))?$"
        },
        "role": {
            "enum": [ "listener", "member", "moderator", "owner" ]
        }
    },
    "required": [ "identity" ]
}

Properties

  • address - The address of the member, in the name@domain/instance format, being the instance information optional.
  • role - The role of the identity in the group. The possible values are:
    • listener - The member can only receive messages from the group, and doesn't have permission to send.
    • member - The member can send and receive messages to the group. It's the default value.
    • moderator - The member can send and receive messages to the group and can kick and ban contacts from it.
    • owner - The owner have the permission to manage moderators, change and delete the group.

Examples

Getting all group members:

C:

{
    "id": "2aac8738-5507-44bf-b85a-30e146250fa3",
    "from": "gus@breakingbad.com/pollos",
    "method": "get",    
    "uri": "/groups/pollos@groups.breakingbad.com/members"
}

S:

{
    "id": "2aac8738-5507-44bf-b85a-30e146250fa3",
    "from": "server@breakingbad.com/machine1",
    "to": "gus@breakingbad.com/pollos",
    "method": "get",
    "result": "success",
    "type": "application/vnd.lime.collection+json",
    "resource": {
        "total": 3,
        "itemType": "application/vnd.lime.groupmember+json",
        "items": [
            {
                "address": "mike@breakingbad.com",
                "role": "moderator"
            },
            {
                "address": "ww@breakingbad.com"
            },
            {
                "address": "jesse@breakingbad.com"
            },
            {
                "address": "gale@breakingbad.com"
            },
            {
                "address": "victor@breakingbad.com",
                "role": "listener"
            }
        ]
    }
}

Set specific group member:

C:

{
    "id": "2aac8738-5507-44bf-b85a-30e146250fa3",
    "from": "gus@breakingbad.com/pollos",
    "method": "set",    
    "uri": "/groups/pollos@groups.breakingbad.com/members",
    "type": "application/vnd.lime.groupmember+json",
    "resource": {
        "identity": "mike@breakingbad.com",
        "role": "moderator"
    }
}

S:

{
    "id": "2aac8738-5507-44bf-b85a-30e146250fa3",
    "from": "server@breakingbad.com/machine1",
    "to": "gus@breakingbad.com/pollos",
    "method": "get",
    "result": "success"
}


Ping

Allows the nodes to test the network connectivity.

URI templates

    lime://{ownerIdentity}/ping

MIME type

    application/vnd.lime.ping+json

JSON Schema


{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "ping",
    "type": "object"
}

Example

Ping request from the server:

S:

{
    "id": "2aac8738-5507-44bf-b85a-30e146250fa3",
    "from": "server@breakingbad.com/server1",
    "to": "saul@breakingbad.com/tv",
    "method": "get",
    "uri": "/ping"
}

C:

{
    "id": "2aac8738-5507-44bf-b85a-30e146250fa3",
    "from": "saul@breakingbad.com/tv",
    "to": "server@breakingbad.com/server1",
    "method": "get",
    "result": "success",
    "type": "application/vnd.lime.ping+json",
    "resource": {}
}


Presence

Represents the availability status of a node in a network. A node can only receive envelopes from another nodes in the network if it sets its presence to an available status (except from the server, who always knows if a node is available or node, since this information is enforced by the existing session). In a new session, the node starts with a unavailable status.

URI templates

    lime://{ownerIdentity}/presence

MIME type

    application/vnd.lime.presence+json

JSON Schema


{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "presence",
    "type": "object",
    "properties": {
        "status": {
            "enum": [
                "unavailable",
                "available",
                "busy",
                "away"
            ]            
        },
        "message" : {
            "type": "string"
        },
        "routingRule" : {
            "enum": [
                "instance",
                "identity",
                "identityByPriority",
                "promiscuous",
                "domain"
            ]
        },
        "priority" : {
            "type": "integer"
        },
        "instances" : {
            "type": "array",
            "items": {
                "type": "string"
            }
        }
        
    },
    "required" : [ "status" ]
}

Properties

  • status - The node presence status. The possible values are:
    • unavailable - The node is not available for messaging and SHOULD not receive any envelope by any node, except by the connected server.
    • available - The node is available for messaging and envelopes can be routed to the node according to the defined routing rule.
    • busy - The node is available but the senders should notice that it is busy and doesn't want to the disturbed or it is on heavy load and don't want to receive any envelope.
    • away - The node is available but the senders should notice that it may not be reading or processing the received envelopes.
  • message - A status message associated to the presence status.
  • routingRule - Rule to the server route envelopes addressed to the identity. The possible values are:
    • instance - Only delivery envelopes addressed to the current session instance (name@@domain/instance).
    • identity - Delivery envelopes addressed to the current session instance (name@@domain/instance) and envelopes addressed to the identity (name@@domain).
    • identityByPriority - Delivery envelopes addressed to the current session instance (name@@domain/instance) and envelopes addressed to the identity (name@@domain) if the value of the priority property is the largest among the available nodes of the identity.
    • promiscuous - Delivery any envelopes addressed to the identity (name@@domain), including the envelopes addressed to any specific instance.
    • domain - Delivery any envelopes addressed to the node domain, including the envelopes addressed to any specific instance. This rule can be used only by clients with domain authentication level.
  • priority - The value of the priority for the identityByPriority routing rule.
  • instances - The instance names that have a defined presence in the server for a specified identity. This property is returned when the from value of the command envelope hasn't an specified instance.

Example

Setting the presence:

C:

{
    "id": "2aac8738-5507-44bf-b85a-30e146250fa3",
    "from": "saul@breakingbad.com/tv",
    "method": "set",
    "uri": "/presence",
    "type": "application/vnd.lime.presence+json",
    "resource": {
        "status": "available",
        "message": "Better call Saul!"
    }
}

S:

{
    "id": "2aac8738-5507-44bf-b85a-30e146250fa3",
    "from": "server@breakingbad.com/machine1",
    "to": "saul@breakingbad.com/tv",
    "method": "set",
    "result": "success"  
}


Quota

Allows the nodes to manage the session envelope quota configuration.

URI templates

    lime://{ownerIdentity}/quota

MIME type

    application/vnd.lime.quota+json

JSON Schema


{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "quota",
    "type": "object",
    "properties": {
        "throughput" : {
            "type": "integer"
        },
        "maxEnvelopeSize" : {
            "type": "integer"
        }
    }
}

Properties

  • throughput - Indicates the cap of envelopes per second that the session can send and receive. If the value is 0 or is not defined, this capability is unbounded. If a session exceeds the limit, it will be finished by the server. Usually, only the server is allowed to change this property in a session.
  • maxEnvelopeSize - The uncompressed size limit of the envelopes that can be sent in the session. If the value is 0 or is not defined, this capability is unbounded. If a envelope sent in the session exceeds the limit, it will be finished by the server. Usually, only the server is allowed to change this property in a session.

Example

Getting the user quota:

C:

{
    "id": "2aac8738-5507-44bf-b85a-30e146250fa3",
    "from": "hank@breakingbad.com/dea",
    "method": "get",
    "uri": "/quota"
}

S:

{
    "id": "2aac8738-5507-44bf-b85a-30e146250fa3",
    "from": "server@breakingbad.com/machine1",
    "to": "hank@breakingbad.com/dea",
    "method": "get",
    "result": "success",
    "type": "application/vnd.lime.quota+json",
    "resource": {
        "throughput": 5,
        "maxEnvelopeSize": 2048
    }
}


Contact

Allows the nodes to manage the contacts of their accounts.

URI templates

    lime://{ownerIdentity}/contacts
    lime://{ownerIdentity}/contacts/{contactIdentity}

MIME type

    application/vnd.lime.contact+json

JSON Schema


 {
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "contact",
    "type": "object",
    "properties": {
        "identity": {
            "title": "identity",
            "type": "string",
            "pattern": "^(?:([^\"&'/:<>@@]{1,1023})@@)?([^/@@]{1,1023})$"
        },
        "name": {
            "type": "string",
        },
        "address": {
            "type": "string"
        },
        "city": {
            "type": "string"
        },
        "email": {
            "type": "string"
        },
        "phoneNumber": {
            "type": "string"
        },
        "photoUri": {
            "type": "string",
            "format": "uri"
        },
        "cellPhoneNumber": {
            "type": "string"
        },
        "gender": {
            "type": "string"
        },
        "timezone": {
            "type": "integer"
        },
        "culture": {
            "type": "string"
        },  
        "extras": {
            "type": "object"
        },
        "isPending": {
            "type": "boolean"
        },
        "sharePresence": {
            "type": "boolean"
        },
        "shareAccountInfo": {
            "type": "boolean"
        },
        "group": {
            "type": "string"
        }
    },
    "required": [ "identity" ]
}
    

Properties

  • identity - The identity of the contact, in the name@domain format.
  • name - The name of the contact. This information is only visible by the roster owner.
  • address - The contact address.
  • city - The contact city name.
  • email - The contact e-mail address.
  • phoneNumber - The contact phone number.
  • photoUri - The contact photo URI.
  • cellPhoneNumber - The contact cellphone number.
  • gender - The contact gender (male/female).
  • timezone - The contact timezone relative to GMT.
  • culture - The contact culture info, in the IETF language tag format.
  • extras - A generic JSON property to store any key/value strings.
  • isPending - Determines if the contact is pending for acceptance by the roster owner. The default value is false.
  • sharePresence - Indicates if the roster owner wants to share presence information with the contact. If true, the server provides a get delegation permission to the contact identity into the roster owner presence resource. The default value is true.
  • shareAccountInfo - Indicates if the roster owner wants to share account information with the contact. If true, the server provides a get delegation permission to the contact identity into the roster owner account resource. The default value is true.
  • group - Indicate the contact group name.

Examples

Getting the first three contacts:

C:

{
    "id": "c2a33f0b-717d-4573-bb63-43dc8293059e",
    "from": "hank@breakingbad.com/dea",
    "method": "get",
    "uri": "/contacts?take=3"
}

S:

{
    "id": "c2a33f0b-717d-4573-bb63-43dc8293059e",
    "from": "server@breakingbad.com/machine1",
    "to": "hank@breakingbad.com/dea",
    "method": "get",
    "result": "success",
    "type": "application/vnd.lime.collection+json",    
    "resource": {
        "total": 15,
        "itemType": "application/vnd.lime.contact+json"
        "items": [
            {
                "identity": "marie@breakingbad.com",
                "name": "Marie Schrader"            
            },
            {
                "identity": "gomez@breakingbad.com",
                "name": "Gomie"            
            },
            {
                "identity": "ww@breakingbad.com",
                "name": "Walt"            
            }
        ]               
    }
}

Adding a contact to the roster:

C:

{
    "id": "c2a33f0b-717d-4573-bb63-43dc8293059e",
    "from": "hank@breakingbad.com/dea",
    "method": "set",
    "uri": "/contacts",
    "type": "application/vnd.lime.contact+json",    
    "resource": {
        "identity": "gomez@breakingbad.com",
        "name": "Gomie"            
        
    }
}

S:

{
    "id": "c2a33f0b-717d-4573-bb63-43dc8293059e",
    "from": "server@breakingbad.com/machine1",
    "to": "hank@breakingbad.com/dea",
    "method": "set",
    "result": "success"  
}

Removing a contact from the roster:

C:

{
    "id": 062b8d02-d5f1-4c15-b513-54c1a1d8d5a3",
    "from": "hank@breakingbad.com/dea",
    "method": "delete",
    "uri": "/contacts/gomez@breakingbad.com"
}

S:

{
    "id": "062b8d02-d5f1-4c15-b513-54c1a1d8d5a3",
    "from": "server@breakingbad.com/machine1",
    "to": "hank@breakingbad.com/dea",
    "method": "set",
    "result": "success"  
}