diuit product overview
TRANSCRIPT
B2C CHAT APIMOBILE AND WEB MESSAGING, BUILT FOR
DEVELOPERSCreated by / Momo Lee @zxcvbnius
APP CLIENT SIDE
Fetching information from databaseP2P tunnel connectionhttp servicefile live streaming...
LOGINDiuitMessagingAPI.loginWithAuthToken(new DiuitCallback<JSONObject>() { @Override public void onSuccess(final JSONObject result) { // get session // put your code } @Override public void onFailure(final int code, final JSONObject result) { // put your code } }, authToken);
LIST CHAT ROOMDiuitMessagingAPI.listChats(new DiuitCallback<ArrayList<DiuitChat>>() { @Override public void onSuccess(final ArrayList<DiuitChat> chats) { // if success, return chatArrayList }
@Override public void onFailure(final int code, final JSONObject resultObj) { // if failure, it will return error code and result } });
SEND MESSAGEchat.sendText (String text, ...); chat.sendImage(Image image, ...); chat.sendFile (File file, ...);
AUTHENTICATING USERAuthenticate User On Your Account ServerObtaining Authentication Nonce
Generate JWT TokenLogin to Messaging Server
curl -X GET \ -H "x-diuit-application-id: ${DIUIT_APP_ID}" \ -H "x-diuit-api-key: ${DIUIT_APP_KEY}" \ https://api.diuit.net/1/auth/nonce
curl -X POST \ -H "x-diuit-application-id: ${DIUIT_APP_ID}" \ -H "x-diuit-api-key: ${DIUIT_APP_KEY}" \ -H "Content-Type: application/json" \ -d '{"authToken":${JWT_TOKEN}, "deviceId": ${DEVICE_ID}, "platform": ${PUSH_PLATFORM}https://api.diuit.net/1/auth/login