Users

Each person staffing your chat service should be given a user account. User accounts are used to configure your chat service and to answer chats. The account created when you first signed up for our service is called your top-level account. All of your user accounts will be managed and owned by this top-level account.

Authentication

LibraryH3lp supports cookie-based authentication. To learn more, you can read the details on authentication.

HTTP and HTTPS

Requests are served over HTTPS. To ensure data privacy, unencrypted HTTP is not supported.

User Instance Resource

An user instance resource represents a single user managed by the user account provided during authentication.

Resource URI

/2011-12-03/users/{UserId}

Resource Properties

A User resource is represented by the following properties:

Property Description
id Unique integer identifier for a user.
type String that is always "user"
name String of up to 40 characters that uniquely identifies the user. Name is a person's username for the system. The name of a user forms the node identifier of a user's JID (Jabber ID) and thus must conform to the XMPP standard for node identifier and be lowercase. That is, user names cannot contain spaces or any of the characters "&'/:<>@\. Because both queues and users have JIDs, a queue cannot have the same name as a user and vice versa.
email String containing an e-mail address for the user. This e-mail address is used when forwarding chat transcripts or tagging a chat transcript for follow-up. The e-mail address is also used as a forwarding address if someone sends an e-mail to a user's JID. Forwarding functionality not yet implemented.
show String reflecting the current availability of the user for chat. Possible values are "chat", "available", "dnd", "away", "xa", "unavailable". The Presence API also provides this information.
status String containing a natural-language description of a user's availability.

HTTP GET

Allows you to retrieve a user's information.

Response

Returns a JSON response containing a representation of a user, including the properties above.

Example

GET /2011-12-03/users/30826

{
  "id": 30826,
  "type": "user",
  "name": "test-user",
  "email": "test-user@somecompany.com",
  "show": "unavailable",
  "status": ""
}

HTTP POST

Not supported.

HTTP PUT

Allows you to modify the properties of an existing user.

Optional PUT data

You may include, as JSON PUT data, any of the following properties.

Property Description
name String of up to 40 characters that uniquely identifies the user. Name is a person's username for the system. The name of a user forms the node identifier of a user's JID and thus must conform to the XMPP standard for node identifier and be lowercase. That is, user names cannot contain spaces or any of the characters "&'/:<>@\. Because both queues and users have JIDs, a queue cannot have the same name as a user and vice versa.
password String containing the password for the new user.
email String containing an e-mail address for the user. This e-mail address is used when forwarding chat transcripts or tagging a chat transcript for follow-up. The e-mail address is also used as a forwarding address if someone sends an e-mail to a user's JID. Forwarding functionality not yet implemented.

Response

Always returns a JSON response containing a representation of the user resource. If a parameter contains an illegal value, the illegal value is ignored and the original value retained and returned in the representation.

Example

PUT /2011-12-03/users/35158
{
  "name": "amy-renamed-user"
}

[
  {
    "id": 35158
    "type": "user",
    "name": "my-renamed-user",
    "email": "",
    "show": "unavailable",
    "status": ""
  }
]

HTTP DELETE

Allows you to delete a user.

Response

Returns a JSON response with the following properties:

Property Description
success Boolean indicating if the request was successful.
message Optional. If success is null, message is a string describing the reason for the failed request.

Example

DELETE /2011-12-03/users/35158

{
  "success": true
}

Users List Resource

The Users list resource represents the set of Users managed by the user whose credentials were used to make the API request.

Resource URI

/2011-12-03/users

HTTP GET

Returns all the users managed or created by the user whose credentials were used to make the API request.

Response

Returns a JSON response containing a list of User resources.

Example - list all users

GET /2011-12-03/users

[
  {
    "id": 30826
    "type": "user",
    "name": "test-user",
    "email": "test-user@somecompany.com",
    "show": "unavailable",
    "status": ""
  }, {
    "id": 35158
    "type": "user",
    "name": "my-user",
    "email": "",
    "show": "unavailable",
    "status": ""
  },
]

HTTP POST

Allows you to create a new user.

Required POST data

Each post must include, as JSON POST data, all of the following properties.

Property Description
name String of up to 40 characters that uniquely identifies the user. Name is a person's username for the system. The name of a user forms the node identifier of a user's JID and thus must conform to the XMPP standard for node identifier and be lowercase. That is, user names cannot contain spaces or any of the characters "&'/:<>@\. Because both queues and users have JIDs, a queue cannot have the same name as a user and vice versa.
password String containing the password for the new user.
type Always "user".

Response

If successful, returns a JSON response containing the resource representation of the newly created user. If unsuccessful, returns a JSON response with the following properties:

Property Description
success Boolean indicating if the request was successful.
message Optional. If success is null, message is a string describing the reason for the failed request.

Example - successful creation of a user

POST /2011-12-03/users
{
  "name": "my-new-user",
  "password": "secret",
  "type": "user",
}

[
  {
    "id": 35158,
    "type": "user",
    "name": "my-new-user",
    "email": "",
    "show": "unavailable",
    "status": ""
  }
]

Example - failure to create a user

POST /2011-12-03/users
name=my-new-user&password=secret&type=user

{
  "success": null,
  "message": "Sorry, a user with that name already exists. Please choose another name."
}

HTTP PUT

Not supported.

HTTP DELETE

Not supported.