Skip to content
endtwist edited this page Sep 14, 2010 · 14 revisions

This page will be updated as the API for Inko develops and becomes more fleshed out.

/listen

Opens a listening connection with the server. Connection will remain open until either it expires or the server sends a response. Responses will be in JSON format.

Params

  • callback — If you want the data returned in JSONP, rather than plain JSON, provide a callback function. Data will automatically be wrapped into a function call. (e.g., /listen?callback=jsonp129482842)

Returns
Whatever data is sent from the server or another client to this client. Always in JSON format.

/assist

If you are an agent, the next guest in the queue will be assigned to you and a new room for you and the guest will be created. Guest will be removed from the queue and your availability will be updated (if applicable).

Returns
JSON string.
{type: "joined", room: "room id", topic: "room topic if set", guest: {.../* info about the guest */...}}

/guests

Get a list of all the guests currently in the queue. Guests being assisted will not appear in this list. Only available to agents.

Returns
JSON string.
["username", "username2", ...]

/list

Get a list of all currently connected users, including agents and queued guests. Only available to agents.

Returns
JSON string.
{available_agents: ["username", ...], unavailable_agents: ["username", ...], guests: ["username", ...]}

/message[/:id?]

Send a message to the room :id. Will only work when a user has already joined the room.

Params

  • :id — the ID of the room. If not provided in the URL, it must be provided as POST parameter id=
  • body — the content body, provided as a POST parameter

Returns
JSON string.
{type: 'success', success: 'message sent'}

/message[/:id?]/typing

Set the user’s typing state in a particular room.

Params

  • :id — the ID of the room. If not provided in the URL, it must be provided as POST parameter id=
  • state — the typing state; one of: ["off", "on", "wait"]

Returns
TBD.

/direct_message

Sends a direct message to another agent without creating a new room (room in the Message object will be empty).

Params

  • agent — the username of the agent who will be messaged
  • body — the content of the message

Returns
JSON string.
{type: 'success', success: 'message sent'}

/join/:id

Join a room, if you have permissions to do so. Does not create a room if it does not yet exist.

Params

  • :id — the ID of the room. Must be in the URL.

Returns
JSON string.
{type: "joined", room: "room id", topic: "room topic if set"}

/leave/:id

Leave a room.

Params

  • :id — the ID of the room. Must be in the URL.

Returns
JSON string.
{type: "left", room: "room id"}

/end/:id

If you are an agent, end a conversation and destroy the room.

Params

  • :id — the ID of the room. Must be in the URL.

Returns
TBD

/create/:name

If you are an agent, create a new, public, room that goes by :name.

Params

  • :name — the name of the room. Must be in the URL.

Returns
TBD

/identify

Identify an unauthenticated guest. All parameters must be past via POST.

Params

  • username — chosen username of the guest
  • question — question that the guest has for the support contributors
  • os — operating system that the guest is current on
  • version — version of Firefox that the guest is using
  • extensions — extensions/add-ons that the guest has installed

Returns
JSON string.
{type: 'success', success: 'identity set'}

/waittime

Get the current estimated queue wait time.

Returns
JSON string
{type: 'waittime', waittime: "..."}

Clone this wiki locally