Overview
Worktual API provides you to access the data from your Worktual Account through API using Private Access token.
This article walks you through how Worktual API helps in automating workflows and sync data within your database. Access Worktual API key token in third party platforms.
Prerequisites:
- You must have Admin access to create a token in Worktual.
- If you don’t have an account in Worktual, create a new account from here https://worktual.in/pricing/ Connect the Worktual account with other third party application using two ways such as,
- Private App Token
- OAuth Token
1.Generate your API Token:
Steps to create authenticate requests for token generation from Worktual:
- Login to your Worktual account as admin. If you don't have an Worktual account, click here to create https://worktual.in/pricing/
- Navigate “Settings” > “Private App” in Worktual.
- Click on “Create a New token” and update the details such as Token name, description and logo (optional).
- Allow the permission to access the modules data for “Read & Write” response.
- Click on “Save” button to generate the token.
- You can use the token from third party apps / Zapier or other tools to access the data from Worktual and vice versa
2.OAuth 2.0
Use OAuth for Authenticating Your App:
To access the Worktual API using OAuth 2.0 authentication, users should create an app under OAuth in Worktual Settings and proceed with the authorisation flow.
Create an app:
- Users can sign in to the https://ccaas.worktual.in/login/ (or) They can create an admin account,use https://worktual.in/
- Select “Settings” in the Worktual account after creating an account .
- Select the OAuth2.0 under the integration module, register a new application .
- Click Create New App -> Enter a name of the application , description, redirect Uri to where redirect uri after authorise with authorisation code and required scope to use the app. The client secret, client ID, and redirect URL are viewable by the registered app.
Authentication :
Get Authorisation code:
The authorisation code flow begins with client redirect to the authorise url. In this request pass the query parameters ,
Parameter:
client_id(required) - The Id provided by the OAuth Application.
response_type(required) - Allowed value code.
Redirect_url(required) - The redirect_uri given to OAuth Application.
state(optional) - State value for ack.
When the user is asked to enter their credentials and complete the authentication, their browser is redirected to the specified redirect url, the Authorisation Code is passed inside the code query parameter , code expires within 10 minutes. This was a temporary authorisation code.
https://your.site.com/callback?code=f04281d639d8248435378b0365de7bd1f53bf452eda187&state= 781ade254fb35f1db7ed5630b8735348428d936d1824
Get Access Token :
Worktual verifies the user credentials , OAuth client_id and redirect_url, user acquired the authorisation_code. By delivering this code to the POST method /token endpoint request, the user can obtain the OAuth token.
Token url :https://api.worktual.co.uk/services/oauth2/v1/token
Headers :
Content-type- application/x-www-form-urlencoded.
Body :
Code(required)- The authorisation code from the redirect uri.
Client_id(required) - Id of the app created.
client_secret(required) - Secret key of the app created.
Grant_type(required) - Default: authorisation_code.
Redirect_url(required) - The redirect_url, same as the code acquired url.
Success response :
Worktual responds to the OAuth2.0 token request with JSON, it contains the token for permanent access_token. Use this access_token to authenticate the API request, to access the worktual resource behalf of on authenticated user.
Copy code
[ { "access_token": "OAUTH2.8SpYgLxttFi7REDONCEUPON" } ]