Log in With Facebook

This API is invoked when a user registers on a business app using Facebook ID, email address, first name, last name, etc.

Headers
  • x-pch-digest
    Type: string
    required

    The signature for the API call

  • Accept
    Type: string
    required

    Advertises which content types the client is able to understand

  • Accept-Language
    Type: string

    Preferred language

  • Content-Type
    Type: string
    required

    Set this header to application/json.

  • User-Agent
    Type: string
    required

    Used to identify the software, device, and application initiating the request, providing information about the client to the server. For details, see User Agent.

Body
application/json
  • client
    Type: string
    required

    OAuth client ID provided by the business

  • user
    Type: object
Responses
  • application/json
  • application/json
  • application/json
Request Example for post/api2/mobile/users/connect_with_facebook
curl https://SERVER_NAME_GOES_HERE.punchh.com/api2/mobile/users/connect_with_facebook \
  --request POST \
  --header 'x-pch-digest: {{$$.env.signature}}' \
  --header 'Accept: application/json' \
  --header 'Accept-Language: en' \
  --header 'Content-Type: application/json' \
  --header 'User-Agent: AppName/AppVersion/BuildNumber (OS; Model; MANUFACTURER; MODEL; OS Version)' \
  --data '{
  "client": "CLIENT_GOES_HERE",
  "user": {
    "facebook_access_token": "ACCESS_TOKEN_GOES_HERE",
    "apn_token": "APN_TOKEN_GOES_HERE",
    "gcm_token": "GCM_TOKEN_GOES_HERE",
    "signup_channel": "MobileFacebook",
    "age_verified_status": true
  }
}'
{
  "access_token": {
    "token": "ACCESS_TOKEN_GOES_HERE",
    "seconds_to_expire": null,
    "revoked_at": null,
    "refresh_token": "REFRESH_TOKEN_GOES_HERE",
    "scopes": [
      "wifi"
    ]
  },
  "user": {
    "address": "ADDRESS_GOES_HERE",
    "avatar_remote_url": null,
    "birthday": "1999-01-01",
    "communicable_email": "test@example.com",
    "city": "Mountain View",
    "created_at": "2016-03-16T11:40:07+00:00",
    "email": "test@example.com",
    "email_verified": false,
    "facebook_signup": true,
    "favourite_location_ids": "304155",
    "favourite_store_numbers": "1023",
    "fb_uid": "FB_UID_GOES_HERE",
    "first_name": "FIRST_NAME_GOES_HERE",
    "gender": "male",
    "last_name": "LAST_NAME_GOES_HERE",
    "marketing_email_subscription": true,
    "marketing_pn_subscription": true,
    "migrate_status": false,
    "passcode_configured_for_giftcards": false,
    "phone": "1111111111",
    "profile_field_answers": {},
    "referral_code": "REFERRAL_CODE_GOES_HERE",
    "referral_path": "URL_GOES_HERE",
    "secondary_email": "test@example.com",
    "state": "California",
    "superuser": false,
    "terms_and_conditions": false,
    "title": null,
    "updated_at": "2016-03-16T11:40:08+00:00",
    "user_as_barcode": "1111111",
    "user_as_qrcode": "QR_CODE_GOES_HERE",
    "user_code": "P11111111",
    "user_id": 111111111,
    "user_relations": [],
    "zip_code": "30201",
    "anniversary": "2013-07-13",
    "verification_mode": null,
    "apple_signup": null,
    "apple_uid": null,
    "has_generated_fb_email": false,
    "sms_subscription": true,
    "apple_pass_url": "APPLE_PASS_URL_GOES_HERE",
    "google_pass_url": "GOOGLE_PASS_URL_GOES_HERE",
    "age_verified_status": true,
    "user_joined_at": "2016-03-16T11:40:07+00:00"
  }
}