API   ->   Token

xAuthToken


Token is the credential information that needs to be passed when calling all APIs. If you want to call the API, you need to carry the application information and user information to the specified end point to apply for a token. This means that one token corresponds to one application information and one user information. If you want to use the identity of several different users to call the API, you need to apply for a token for each user.

Token is the first step for the APIs.

Example:

https://www.cubedrive.com/lite/getLogin

Parameters:

http method: GET/POST

Developers need to cache x-auth-token for subsequent interface calls (note: this interface cannot be called frequently, otherwise it will be intercepted frequently). When the x-auth-token is invalid or expired, it needs to be re-acquired. There is no guarantee that the token will continue to be valid during the validity period. Developers should implement the logic for re-acquiring access_token when it expires. x-auth-token reserves at least 256 bytes of storage space.

Return example

{
	"success":true,
	"systemInfo":{
		"logoPath":"https://www.cubedrive.com/lite/images/customer/REDBEANDATA.png",
		"language":"zh_CN",
		"systemName":"REDBEANDATA",
		"systemDesc":"CubeDrive: application builder",
		"showAppModule":true,
		"showHelpModule":true,
		"canSelfRegister":true
	},
	"userLang":"zh_CN",
	"userObj":{
		"id":"14r7AYizW6c",
		"firstname":"John",
		"lastname":"Doe",
		"name":"John Doe",
		"imagepath":"https://www.cubedrive.com/lite/userFile/redbeandata/users/user22/profile/thumb_people-1586059479881.png",
		"description":null,
		"username":"xxxxx",
		"email":"xxxx@cubedrive.com",
		"enabled":null,
		"role":"user",
		"roleId":2,
		"createDate":null,
		"maxApp":null,
		"maxShared":null,
		"maxRecords":null,
		"maxSpace":null
	},
	"x-auth-token": "32997522-0c9f-4336-80fb-fef717e28248"
}
    

Use token


After obtaining the token, user can use the API provided by the platform. When calling the API, user only need to add the Authorization request header (Headers) as shown below.

X-Auth-Token: {{xAuthToken}}
please replace {{xAuthToken}} with x-auth-token value.

User can also pass taken as url parameter:

https://www.cubedrive.com/lite/commonPage?page=formData&x-auth-token={{xAuthToken}}


Validate token


The user can query whether the x-auth-token is valid through this interface.

https://www.cubedrive.com/lite/verifyAuthToken?authToken=9e2373f7-b3de-4ad4-9606-59b8c9cb70b6
If it works, the return result as following.
{"success":true,"valid":true}