Socialboards
  • Developer hub
  • APIs
    • Ticket API
      • Getting Started
        • Guidelines and data privacy
      • Authorization
        • Access tokens
      • Categories
      • Custom Fields
      • Action Log
      • Notes
      • Replies
      • Tags
      • Tickets
      • Teammates
      • User Groups
      • Widgets
      • Webhooks
        • Getting Started
        • Create Endpoint
        • Configure the Webhooks
        • Testing your webhooks
      • Reference
        • Endpoints
          • Get Access Token v2
          • Get Full Community Category List
          • Get Subcategories by Parent Id
          • Get Category By Id
          • Get Full Community Custom Field List
          • Add Custom Field
          • Get Custom Field
          • Get All Teammates
          • Get All User Groups for Community
          • Update Custom Field
          • Delete Custom Field
          • Create Ticket
          • List Tickets
          • List Ticket Ids By Field Ids
          • Get Ticket by Id
          • Update Ticket Custom Field Value
          • Update Ticket Assignee
          • Get Ticket Log
          • Update Ticket Status
          • Update Ticket Category (Obsolete)
          • Update Ticket Category
          • Create Reply
          • List Replies
          • Add Note To Ticket
          • Update Note
          • Delete Note
          • List tags
          • Replace Ticket Tags
          • Replace Reply Tags
          • Get Widget Schedule List
        • API Request Result
        • Webhook Payload
        • Objects
          • Base Attachment
          • Category
          • Custom Field
          • Custom Field Id with Value
          • Custom Field Possible Value
          • Custom Field Value
          • Custom Times Widget Schedule
          • Note
          • Reply
          • Reply/Note Creator
          • Reply Properties
          • Schedule Time
          • Tag
          • Teammate
          • Ticket
          • Ticket Action Included Items
          • Ticket Creator
          • Ticket Id with Field Value
          • Ticket Log
          • Ticket Properties
          • User
          • User Group
          • Widget Schedule
        • Events
          • Ticket Creation
          • Ticket Status Change
          • Ticket Tags Change
          • Ticket Category Change
          • Reply Creation
          • Reply Update
          • Reply Deletion
          • Note Creation
          • Note Update
          • Note Deletion
        • Enumerations
          • Custom Field Types and Values Formats
          • Sentiment
          • Ticket Action Type
          • Ticket List Order By
          • Ticket Source
          • Ticket Status
          • User Role
          • Detailed Ticket Source
      • Glossary
    • External Chat API
      • Conversations Overview
      • Configure the Webhooks
      • Glossary
      • Reference
        • Endpoints
          • Create conversation
          • Add messages to conversation
          • Get conversation by id
          • List conversation messages
          • Get conversation queue information
          • Get takeover state
          • Change takeover state
          • Update conversation feedback
          • Update conversation latest url
          • Close conversation
        • Objects
          • Bot
          • Conversation
          • Conversation feedback
          • Conversation message
          • Conversation takeover
          • Conversation queue position
          • User
          • User Value
        • Events
          • Conversation created
          • Conversation Message Added
          • Conversation Takeover State Changed
          • Conversation Status Changed
        • Enumerations
          • Bot type
          • Order by
          • User status
          • Conversation Status
    • FAQ API
      • Glossary
      • Categories
      • FAQ Instances
      • Tags
      • Topics
      • Reference
        • Endpoints
          • List FAQ Instances
          • List Tags
          • List Categories
          • List Topics
          • Get Specific Topic
          • Add Vote to Topic
          • Increase View Count for Topic
          • Search Topics by Params
        • Objects
          • Attachment
          • Category
          • Instance
          • Tag
          • Topic
          • Topic Search Result
        • Enumerations
          • Localization Language
          • Template Type
          • Topic Downvote Reason
          • Topics Sort Options
    • Support Widget
      • Installation
      • Configuration options
      • Full script example
      • Javascript changelog
      • Widget schedule API
    • Reporting & Statistics
      • Data warehouse (DWH)
        • Entity relationship diagram (ERD)
        • Most used views and values
      • Reports and dashboards
  • Security
    • Introduction to Security
    • Data centers & network security
    • Product security features
    • Application security
    • Data Processing
    • Sub-Processors
      • 2023-04 Intility AS
        • Addendum 2023-4
  • Updates
    • Changelog
Powered by GitBook
On this page
  • Tokens
  • Usage scheme
  • How to Get a Refresh Token

Was this helpful?

  1. APIs
  2. Ticket API
  3. Authorization

Access tokens

Generating and obtaining tokens for Ticket api

PreviousAuthorizationNextCategories

Last updated 1 year ago

Was this helpful?

Tokens

The second version of the Ticket API supports authorization scheme with refresh + access tokens. To work with it you'll need to use access and refresh tokens.

  • Access tokens is short-lived token (an hour) and they allow your app to access the Ticket API.

  • Refresh tokens allow you to create new access tokens. They must be saved in a secure place.

All API endpoints require an access token, so each time you access an endpoint, your request must have one.

Usage scheme

All refresh tokens must be stored and used in secure way. Refresh tokens supposed to be used from your server to create new access tokens (server to server call) which can be transferred to your client's application and then client's application can call the Ticket API.

So when your client's application needs to call the Ticket API, it can use existed access token or calls your server side application, to get a new access token. The server side application can return active access token or obtain a new one from the Ticket API.

How to Get a Refresh Token

Open Settings by clicking on your user’s avatar in the top right corner of inbox and choosing “Settings”.

Open “Installation” tab.

Open “Public API” tab.

On this page you can see your Client ID and create/delete your refresh tokens. Client ID and one of our refresh tokens are required to create short-lived access tokens.

During creating a new refresh token you will need to specify the name for this token, it could describe purposes for which do you want to use this token.

To create new access token you need to send the following request:

POST https://api.socialboards.com/token

Obtaining new access tokens requires specifying 3 parameters: client_id, refresh_token, grant_type

A body of this particular request should be sent in x-www-form-urlencoded data format.

Parameters

Name
Type
Required
Comments

grant_type

string

yes

Must be set to 'refresh_token'

refresh_token

string

yes

One of your refresh tokens

client_id

string

yes

Your Client ID

Response

{
    "access_token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJjaWQiOiIxIiwidHlwZSI6IkNvbW11bml0eSIsIm5iZiI6MTU4MjU1ODU1MiwiZXhwIjoxNTgyNTYyMTUyLCJpc3MiOiJzb2NpYWxib2FyZHMuY29tIiwiYXVkIjoiZjUyNWExNzAtOWM4OS00MGI3LWE2ODctNjczZWZkN2YyMThiIn0.rXiErxy4IlvhNs10Ovwg61mAa4cX36_E2Rw3nghD0R7KfxuIkeXBmQgPagqfEL1gk6d-W5pNQ_py2h3p23zM_g",
    "token_type": "bearer",
    "expires_in": 3599,
    "refresh_token": "c5ngLXd0zVrgN6U7jdAw2EOGd9fj0GkZEFOvdd6yEHo="
}

access_token from the response can be used as Bearer token to call endpoints.

You need to set it into Authorization header in the following way: Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJjaWQiOi...