Skip to content

Reference AccessToken

Benedikt Schulze Baek edited this page Apr 28, 2017 · 11 revisions

This method will create a PageAccessToken.

POST https://api.chayns.net/v2.0/{LocationID}/AccessToken

Snippet

Header
Authorization: Basic {TappID}:{Secret}

The part 'TappID:Secret' has to be Base64 encoded.

Parameter

  • LocationID : int - Can be found in chayns.env.site.
  • TappID : int - Can be found in chayns.env.site.
  • Secret : string - Your tapp secret.
  • Permissions : string[] - An array containing the permissions you want to get. It has to be set in the request body.

Result

  • PageAccessToken : string - The pageAccessToken for the current location and tapp.

This method will return information about a PageAccessToken or a UserAccessToken.

GET https://api.chayns.net/v2.0/{LocationID}/AccessToken

Snippet

Header
Authorization: Bearer {AccessToken}

Provide the PageAccessToken or TobitAccessToken you want to read.

Parameter

  • LocationID : int - Can be found in chayns.env.site.
  • AccessToken : string - The accessToken you want to read. It can be either a pageAccessToken or a tobitAccessToken. It is set in the authorization header.
  • RequiredUacGroups : int[] - Set as url parameter (e.g. ?RequiredUacGroups=[1,5,500]). If set and requesting user data they will be returned only if the user is member of at least one of the provided uac groups.

Result (PageAccessToken)

  • developerId : int - The developerId of the user who added the developerTapp to the tapp administration in the TSPN.
  • tappId: int - The id of the tapp the accessToken was created on.
  • locationId : int - The id of the location the accessToken was created on.
  • expires : Date - The expiration date of the accessToken.
  • tokenType.type : int - Specifies whether the token is a pageAccessToken(3) or tobitAccessToken(1).
  • tokenType.name : string - The name of the specific token.
  • permissions : string[] - An array containing all the permissions this pageAccessToken contains.

Result (UserAccessToken)

  • locationId : int - The id of the location the accessToken was created on.
  • userId : int - The id of the user the token belongs to.
  • personId : string - The personId of the user the token belongs to.
  • facebookUserId : string - The facebookUserId of the user the token belongs to.
  • firstName : string - The firstname of the specified user.
  • lastName : string - The lastname of the specified user.
  • expires : Date - The expiration date of the accessToken.
  • tokenType.type : int - Specifies whether the token is a pageAccessToken(3) or tobitAccessToken(1).
  • tokenType.name : string -The name of the specific token.
Clone this wiki locally