TapTalk.io Documentation
  • Introduction
  • OneTalk Omnichannel Documentation
    • Getting Started with OneTalk
      • Team Members
      • Add Topic
      • Assign Agent to Topic
      • Paid Proactive Chat
    • Channel Integration
      • Telegram Integration
      • WhatsApp SME Integration
      • Instagram DM Integration
      • Facebook Messenger Integration
      • Live Chat Integration (iOS, Android, Web)
        • OneTalk Live Chat for Android
          • Get Started
          • Event Listener
          • Authentication
          • Case & Topic
          • Navigate Live Chat UI
          • Customize UI Appearance
        • OneTalk Live Chat for iOS
          • Get Started
          • Background Process in TapTalk.io Omnichannel iOS
          • Event Delegate
          • Authentication
          • Case & Topic
          • Navigate Live Chat UI
          • Customize UI Appearance
        • OneTalk Live Chat for Web
          • Get Started
          • Callback
          • Method
        • OneTalk Live Chat for React Native
          • Get Started - Android
          • Authentication - Android
          • Get Started - iOS
          • Authentication - iOS
        • OneTalk Live Chat for Flutter
          • Get Started - Android
          • Get Started - iOS
      • Google Business Messages Integration
      • Google Business Profile Integration
      • Tokopedia Integration
    • Integration API
      • Inbox API
      • User/Contact API
    • Live Chat Widget Callback Function
    • Social Channel Button
    • Custom Chatbot Integration
      • Get Started
      • Edit or Delete Chatbot
      • Development
    • QnA via API
    • Webhook
  • PowerTalk Chat SDK Documentation
    • Getting Started with PowerTalk
    • PowerTalk Android
      • Get Started
      • Enable Chat Features
      • Authentication
      • TapUI and TapCore
      • Background Process in TapTalk.io
      • Connection
      • Event Listener
      • Push Notification
      • General
      • User
      • Room List
        • Room List - TapUI
        • Room List - TapCore
      • Chat Room and Messages
        • Chat Room and Messages - TapUI
        • Chat Room and Messages - TapCore
      • Contact
      • Message Type
      • Customize UI Appearance
      • Customize Chat Features
      • Customize Chat Message Bubble
      • Customize Navigation Bar
      • Deep Linking
      • Error Codes
    • PowerTalk iOS
      • Get Started
      • TapUI and TapCore
      • Background Process in TapTalk.io
      • Implement Application Delegate
      • Authentication
      • Connection
      • Event Delegate
      • Push Notification
      • General
      • User
      • Room List
        • Room List - TapUI
        • Room List - TapCore
      • Chat Room and Messages
        • Chat Room and Messages - TapUI
        • Chat Room and Messages - TapCore
      • Contact
      • Message Type
      • Customize UI Appearance
      • Customize Chat Features
      • Customize Chat Message Bubble
      • Customize Navigation Bar
      • Deep Linking
      • Error Codes
    • PowerTalk React Native
      • Get Started - Android
      • Get Started - iOS
    • PowerTalk Flutter
      • Get Started - Android
      • Get Started - iOS
    • Javascript SDK
      • Get Started
      • Authentication
      • Connection
      • General
      • Event Listener
      • User
      • Room List
      • Chat Room
      • Messages
      • Contact
      • Message Type
    • Server API
      • Get Started
      • Base URL
      • Authentication
      • User
      • Contact
      • Message
      • Room
    • Webhook
      • Get Started
      • Webhook Payload
  • MeetTalk SDK Documentation
    • Getting Started with MeetTalk
    • MeetTalk Android
      • Get Started
      • Event Listener
    • MeetTalk iOS
      • Get Started
      • Implement Application Delegate
      • Event Delegate
  • SendTalk API Documentation
    • Introduction
    • Whatsapp Verification
Powered by GitBook
On this page
  • Request Auth Ticket
  • Request
  • Success 200
  • Error 4xx

Was this helpful?

  1. PowerTalk Chat SDK Documentation
  2. Server API

Authentication

PreviousBase URLNextUser

Last updated 3 years ago

Was this helpful?

In order to use the abilities of TapTalk.io in your client app, a TapTalk instance must be initiated in each client app through user authentication with TapTalk.io server. An authenticated user account allows the instance to communicate and interact with the server. The following explains how to authenticate with the server.

When the user logs in to your application, your backend server will have to request an Authentication Ticket from TapTalk.io server. TapTalk.io server will return the requested Authentication Ticket and user ID to your backend server. The client application (iOS or Android) can then retrieve the ticket from your backend server to implement TapTalk.io's SDK by initializing the SDK using the obtained Authentication Ticket.

You can see the implementation for TapTalk.io's Mobile SDK by accessing or Android SDK Authentication.

IMPORTANT!

Server Key ID and Server Key Secret will be used to construct a request and add as a HTTP Header. To construct a request, please format your generated Server Key ID and Server Key Secret and wrap it to Base64, so the format will be like this:

encodeToBase64(SERVER_KEY_ID:SERVER_KEY_SECRET) *don't forget to add colon (:) between Server Key ID and Server Key Secret

Then, put the base64 string on your HTTP Header Field with key “Server-Key” and then construct URL request and parameter for the request.

Request Auth Ticket

Request auth ticket on behalf of the specified user, passing along the user's data to be saved to chat server. The auth ticket can be used to request an access token from the chat server. An auth ticket is valid for 1 hour before it expires.

The xcUserID is used to identify an existing user. If it does not exist yet, the user will be saved as a new user.

BASE_URL/v1/server/auth_ticket/request

example:
https://taptalk.io/v1/server/auth_ticket/request

Request

Field

Type

Description

userIPAddress

string

(101) The user's IP address.

userAgent

string

(102) The user agent.

userPlatform

string

(103) The user's platform.

Values: "android", "ios", or "web"

userDeviceID

string

(104) The user's device ID.

xcUserID

string

(105) The user ID from customer's server (maximum 50 characters).

fullName

string

(106) The user's full name.

email (optional)

string

(107) The user's email address.

phone (optional)

string

(108) The user's phone, should start with country code.

username (optional)

string

(109) The user's username.

photoThumbnailURL (optional)

string

(110) The user's thumbnail picture image URL.

photoFullsizeURL (optional)

string

(111) The user's fullsize picture image URL.

userRoleCode (optional)

string

(112) The user's role code.

{
    "userIPAddress": "182.253.177.234",
    "userAgent": "AdvancedRestClient/12.1.14",
    "userPlatform": "android",
    "userDeviceID": "aaaa-bbbb-cccc-dddd",
    "xcUserID": "6",
    "fullName": "Jony",
    "email": "jony@email.com",
    "phone": "08991234567",
    "username": "jony",
    "photoThumbnailURL": "http://www.example.com/photo/thumb/6.jpg",
    "photoFullsizeURL": "http://www.example.com/photo/full/6.jpg",
    "userRoleCode": "user"
}

Success 200

Field

Type

Description

userID

string

The user ID.

ticket

string

The The auth ticket to request an access token.

{
  "status": 200,
  "error": {
    "code": "",
    "message": "",
    "field": ""
  },
  "data": {
    "userID": "6",
    "ticket": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0aWMiOiIxNTM4MzA4MTg3MzAwNDk0MDAwdTIuMzAzN2QzYWU2YjUzZmYxM2E2ZWQyYWQyZGM5YjJjOWQ1YzE2ZTE3ZTYyZTQzYjAwZjZlMDVjMWFkNTMwMjkxNGY5MGZkNDFjNDI2ZDBkN2JlZjU4NmIxMTk4NWNlNjExNWM3NWU2MjYwY2UwYjRhYjFlMGU3ODNlZWU2NWYyODJjNDRmZDcwOWFhMTA1ODM0YTMwMGRiODEwYjcyNzk5NzUxYzI5NWMxYThlNDliNDllNmM1YjhmMmQ0OGE1MDBkMTk0ZjA4NGRhMzk4YWViYjdlN2Y1ZDIxZWU4MTIwZTk3ODA4NTUwNTI5NDBjMmNkZjRiMDIxYzU0NTAxODUzNjE1MzgzMDgxODdlMjI1ZGVjNzE4YzliNWM3NWExOTBjOGI4Y2RmNDBmNWIzZTU0ZGQ4M2M3MTdjMmQ2ZjI1Njg4ZjAyZDc2NWVhYjVkZWY2NThiNGM4YmVjY2RkMTM2MWNlZDAwOTM5MzQxOWQzZmU1ZTI3ZjU5NGY1YmFkYzhhMjdmNjYzMDcyYSIsInVpZCI6MiwiZXhwIjoxNTM4MzExNzg3LCJqdGkiOiJhdDE1MzgzMDgxODczMDA0OTQwMDB1MiIsImlhdCI6MTUzODMwODE4N30.Dh_6a5wq19KBbz_2YX13MP9FM85cl1HC7Eek_0IgqUs"
  }
}

Error 4xx

Name

Description

ParamValidationFailed

The parameter validation failed.

HeaderValidationFailed

The request header validation failed.

{
  "status": 400,
  "error": {
    "code": "40002",
    "message": "Param 'xcUserID' is required",
    "field": "105"
  },
  "data": {}
}
{
  "status": 400,
  "error": {
    "code": "40001",
    "message": "Request headers are required (Server-Key)",
    "field": ""
  },
  "data": {}
}
iOS SDK Authentication
TapTalk.io's Authentication Flow