Create SSO Access Token

Generates authentication token using the security token.

Headers
  • x-pch-digest
    Type: string
    required

    The signature for the API call

  • Content-Type
    Type: string
    required

    Set this header to application/json.

  • Accept
    Type: string
    required

    Advertises which content types the client is able to understand

  • User-Agent
    Type: string
    required

    For details, see User Agent.

Body
application/json
  • client
    Type: string
    required

    Client key of the business

  • security_token
    Type: string
    required

    Security token required to generate the authentication token. For more information on generating the security token, see Mobile SSO Flow.

Responses
  • application/json
  • 400
  • application/json
Request Example for post/api/auth/sso
curl https://SERVER_NAME_GOES_HERE.punchh.com/api/auth/sso \
  --request POST \
  --header 'x-pch-digest: SIGNATURE_GOES_HERE' \
  --header 'Content-Type: application/json' \
  --header 'Accept: application/json' \
  --header 'User-Agent: Punchh/OnlineOrder/1.0/Web/BrowserVersion/OS_Type' \
  --data '{
  "client": "CLIENT_GOES_HERE",
  "security_token": "SECURITY_TOKEN_GOES_HERE"
}'
{
  "token": {
    "access_token": "ACCESS_TOKEN_GOES_HERE"
  },
  "user": {
    "anniversary": null,
    "avatar_remote_url": null,
    "birthday": null,
    "created_at": "2015-08-18T13:53:06Z",
    "email": "test@example.com",
    "fb_uid": "FB_UID_GOES_HERE",
    "first_name": "FIRST_NAME_GOES_HERE",
    "gender": null,
    "id": 111111111,
    "last_name": "LAST_NAME_GOES_HERE",
    "updated_at": "2015-08-18T13:53:06Z",
    "allow_multiple": false,
    "authentication_token": "AUTHENTICATION_TOKEN_GOES_HERE",
    "favourite_locations": "",
    "preferred_menu_items": [],
    "referral_code": "REFERRAL_CODE_GOES_HERE",
    "referral_path": "URL_GOES_HERE",
    "secondary_email": null,
    "user_as_barcode": "1111111",
    "user_as_qrcode": "QR_CODE_GOES_HERE",
    "user_relations": [],
    "wants_menu_notifications": false,
    "profile_field_answers": {},
    "address_line1": null,
    "zip_code": null,
    "phone": null,
    "migrate_status": false,
    "work_zip_code": null,
    "email_unsubscribe": null,
    "allow_push_notifications": true,
    "facebook_signup": false,
    "communicable_email": "test@example.com",
    "access_token": null
  }
}