There are several functions that you will call as the customer performs various actions within the system:
When a customer joins a room, your system should inform the API of their presence with the following command:
POST /customer?key=[KEY] HTTP/1.1 Host: [API]:80 function=joinRoom &performerId=[id] &nickname=[nickname] &customerId=[customerId] &ipAddress=[ipAddress] ®istered=[0|1] &credits=[0|#]
NOTE: The post variables should all be on 1 line. We have separated them here for visual clarity only.
Name | Required | Type | Description |
---|---|---|---|
function | Yes | string | The function you wish to call. |
key | Yes | string | Supplied by VS. Please ask us for your key. |
performerId | Yes | integer | The id of the performer whose room the customer is joining. |
nickname | Yes | string | The nickname of the customer that is doing the joining. |
customerId | No | integer | The id of the customer that is doing the joining, if registered. |
ipAddress | Yes | string | The ip address of the customer that is doing the joining. |
registered | Yes | integer | Whether or not the customer is a "registered" user in your system. |
credits | Yes | integer | The number of credits the customer has the ability to spend in the room. |
Once this request is received the API will verify that all information is valid and will return true or false based on the validity of the call.
HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: [int] { success: true | false, message: [string], nickname: [string] }
Name | Description |
---|---|
success | Whether or not your request was allowed. |
message | An error message if success is false. |
nickname | If successful, the nickname as it will be displayed in our system. It will likely have _#### appended to the provided nickname. |
When the customer leaves the room, your system should inform the API with the following command:
POST /customer?key=[KEY] HTTP/1.1 Host: [API]:80 function=leaveRoom &performerId=[id] &customerId=[id] &nickname=[nickname]
NOTE: The post variables should all be on 1 line. We have separated them here for visual clarity only.
Name | Required | Type | Description |
---|---|---|---|
function | Yes | string | The function you wish to call. |
key | Yes | string | Supplied by VS. Please ask us for your key. |
performerId | Yes | integer | The id of the performer whose room the customer is leaving. |
customerId | No | integer | The id of the customer that is leaving the room, if available. |
nickname | Yes | string | The nickname of the customer that is leaving the room. |
Once this request is received the API will verify that all information is valid and will return true or false based on the validity of the call.
HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: [int] { success: true | false, message: [string] }
Name | Description |
---|---|
success | Whether or not your request was allowed. |
message | An error message if success is false. |
If a customer is sitting quietly in the room, they will eventually be purged and no longer show up in the performer's room list. In order to prevent this purging, your system should inform the API every 10 seconds that a customer is still in the room if they have not sent any chat messages or performed any show activities in that time. This pingRoom request should be sent every 10 seconds after joinRoom, regardless of whether or not the customer is in a private show.
POST /customer?key=[KEY] HTTP/1.1 Host: [API]:80 function=pingRoom &performerId=[id] &customerId=[id] &nickname=[id]
NOTE: The post variables should all be on 1 line. We have separated them here for visual clarity only.
Name | Required | Type | Description |
---|---|---|---|
function | Yes | string | The function you wish to call. |
key | Yes | string | Supplied by VS. Please ask us for your key. |
performerId | Yes | integer | The id of the performer whose room the customer is in. |
customerId | No | integer | The id of the customer that is in the room, if available. |
nickname | Yes | string | The id of the customer that is in the room. |
Once this request is received the API will verify that all information is valid and will return true or false based on the validity of the call.
HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: [int] { success: true | false, message: [string] }
Name | Description |
---|---|
success | Whether or not your request was allowed. |
message | An error message if success is false. |
Your system may need to update our system if a customer has recently purchased credits and is in a show or wishes to tip. In these cases, you can call this function to update our knowledge of the customer's current credit balance. NOTE: This function can only be called for registered customers.
POST /customer?key=[KEY] HTTP/1.1 Host: [API]:80 function=updateCredits &customerId=[id] &credits=[int]
NOTE: The post variables should all be on 1 line. We have separated them here for visual clarity only.
Name | Required | Type | Description |
---|---|---|---|
function | Yes | string | The function you wish to call. |
key | Yes | string | Supplied by VS. Please ask us for your key. |
customerId | Yes | integer | The id of the customer that is in the room, if available. |
credits | Yes | integer | The amount of credits this customer has available to spend. |
Once this request is received the API will verify that all information is valid and will return true or false based on the validity of the call.
HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: [int] { success: true | false, message: [string] }
Name | Description |
---|---|
success | Whether or not your request was valid. |
message | An error message if success is false. |