API

Chat API Documentation

Please see the example usage in samples directory under the chat installation directory.

All functions return true if the operation succeeded, false if an error occurred.

 

Getting User Info - Example

 

SiteORServerReconfig - Example

Reads the Chat Server or a Site definitions from the database.

Useful when some of the Server or Site parameters altered directly in the database.

 

bool SiteORServerReconfig

(

int iSiteId,                      - Site Id to be read or -1 for Chat Server

out int iOutSiteId,          - Site Id re-configured

ref string sErr                - Error String

)

 

UserLogin - Example

Logs in the user. If the User Name is not found in the database, password is ignored..

bool UserLogin

(

string sSessionId,        - User session Id

int iSiteId,                      - Site Id to be entered

string sUserLogin,        - User Name

string sUserPwd,          - User Password

bool bPersistantOnly,   - If set to true only registered users will allowed to enter.

int iRoomId,                   - room Id to be automatically entered after log-in.

ref int iErr,                      - Error number

ref string sErr                 - Error String

)

 

UserLogout - Example

Logs out the user.

bool UserLogout

(

string sUserName,        - User Name

ref int iErr,                      - Error number

ref string sErr                 - Error String

)

 

SiteRoomListGet - Example

Returns '\x0001' delimited Rooms Properties Lists.

bool SiteRoomListGet

(

int iSiteId,

out string  sDelimListOfRoomIds,                          - List Of Room Ids

out string  sDelimListOfRoomNames,                   - List Of Room Names

out string  sDelimListOfOwnerUserNames,         - List Of Owner User Names

out string  sDelimListOfUserCounts ,                    - List Of User Counts

out string  sDelimListOfFlags,                                - List Of Room Types:

Room Types:

0 – regular room

1 – private

2 – moderated

3 – private & moderated

out string  sDelimListOfTopics,                               - List Of Topics

out string  sSiteName,                                              - Site Name

ref string sErr                                                             - Error String

)

 

RoomCreate - Example

Create a new Room

bool RoomCreate

(

int iSiteId,                                   - Site Id in which the new Room will be created.

string sRoomName,                  - Room Name

string sRoomTopic,                   - Room Topic

bool bPrivate,                             - Set to true if the new Room is Private

string sUserName,                     - User Name of the Room Owner

bool bModerated,                      - Set to true if the new Room is Moderated

bool bPersist,                             - Set to true if the new Room should persist in the database

out int iRoomId,                          - the new Room Id

out string sOutUserName,        - User Name of the Room Owner

out int iUserCount,                     - Number of Users in the Room

out string sOutRoomTopic,       - Room Topic

out int iRoomFlag,                      - Room Type

0 – regular room

1 – private

2 – moderated

3 – private & moderated

ref string sErr                               - Error String

)

 

RoomDelete - Example

Delete a Room

bool RoomDelete

(

int iSiteId,                                     - Site Id from which the Room will be deleted.

int iRoomId,                                  - Room Id

string sUserName,                      - User Name of the Room Owner

string sReason,                           - Reason for deleting the Room.

ref string sErr                               - Error String

)

 

RoomUpdate - Example

Update a Room

bool UpdateRoom

(

int iSiteId,                                     - Site Id from which the Room will be deleted.

int iRoomId,                                  - Room Id

string sNewRoomName,            - New Room Name

string sNewRoomTopic,             - New Room Topic.

ref string sErr                               - Error String

)

 

UserListGet - Example

Returns '\x0001' delimited list of Users in a Site

bool UserListGet

(

int iSiteId,                                                    - Site Id

out string sDelimListOfUserNames,        - List Of User Names

out string sDelimListOfUserStatuses,     - List Of User Statuses

out string sDelimListOfFlags,                   - List Of Users Flags composed as bitwise AND of the basic flags:

Regular USER = 0;

CHAT ADMINISTRATOR = 1;

SITE ADMINISTRATOR = 2;

ROOM OPERATOR = 4;

ROOM MODERATOR = 8;

ROOM SPEAKER = 16;

ref string sErr                                               - Error String

)

 

WhoAmI - Example

Returns the User Information for the Session Id; Returns Site Id -1 if a User with this Session Id does not exist.

bool WhoAmI

(

string sSessionId,                                       - Session Id

out int iSiteId,                                               - Site Id

out string sSiteName,                                 - Site Name

out string sUserName,                                - User Name

out int iUserType,                                        - User Type

out string sDelimListOfRoomIds,              - '\x0001' delimited list of Room Ids the User is in

out string sDelimListOfRoomNames,       - '\x0001' delimited list of Room Names the User is in

ref string sErr                                                - Error String

)