Sign in
Logs a user into the app of a business and returns the user's information in the response
- Type: stringx
-pch -digest requiredThe signature for the API call
- Type: stringContent
- Type requiredSet this header to application/json.
- Type: stringAccept
- Language Preferred language
- Type: stringUser
- Agent requiredUsed to identify the software, device, and application initiating the request, providing information about the client to the server. For details, see User Agent.
- Type: stringpunchh
-app -device -id requiredThe app device ID helps Punchh identify each device so that certain rewards can be awarded individually to each device instead of per user. For example, the sign-up reward is given to each device ID to prevent fraudulent sign-ups so that a user cannot do repeated sign-ups from a single device to get rewards. It should not change even if the user resets a device. See the sample code to generate the punchh-app-device-id header.
- Type: stringclientrequired
OAuth client ID provided by the business
- Type: objectuser
- application/json
- application/json
- application/json
- application/json
- application/json
curl https://SERVER_NAME_GOES_HERE.punchh.com/api2/mobile/users/login \
--request POST \
--header 'x-pch-digest: {{$$.env.signature}}' \
--header 'Content-Type: application/json' \
--header 'Accept-Language: en' \
--header 'User-Agent: AppName/AppVersion/BuildNumber (OS; Model; MANUFACTURER; MODEL; OS Version)' \
--header 'punchh-app-device-id: APP_DEVICE_ID_GOES_HERE' \
--data '{
"client": "CLIENT_GOES_HERE",
"user": {
"email": "test@example.com",
"password": "PASSWORD_GOES_HERE"
}
}'
{
"access_token": {
"token": "ACCESS_TOKEN_GOES_HERE",
"seconds_to_expire": null,
"revoked_at": null,
"refresh_token": "REFRESH_TOKEN_GOES_HERE",
"scopes": []
},
"user": {
"address": "",
"anniversary": "2013-02-16",
"avatar_remote_url": null,
"birthday": "1999-01-01",
"city": "",
"communicable_email": "test@example.com",
"created_at": "2019-01-11T09:08:25Z",
"email": "test@example.com",
"email_verified": false,
"facebook_signup": null,
"apple_signup": null,
"apple_uid": null,
"favourite_location_ids": "306082,333070,304374",
"favourite_store_numbers": "12345,0604,1234",
"fb_uid": null,
"first_name": "FIRST_NAME_GOES_HERE",
"gender": "",
"has_generated_fb_email": false,
"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": {
"test1": "Option 1"
},
"referral_code": "REFERRAL_CODE_GOES_HERE",
"referral_path": "URL_GOES_HERE",
"secondary_email": "",
"state": "",
"superuser": false,
"terms_and_conditions": true,
"title": "",
"updated_at": "2020-04-29T04:18:24Z",
"user_as_qrcode": "QR_CODE_GOES_HERE",
"user_code": "P11111111",
"user_id": 111111111,
"preferred_locale": "en",
"user_relations": [],
"zip_code": null,
"verification_mode": null,
"sms_subscription": false,
"apple_pass_url": "APPLE_PASS_URL_GOES_HERE",
"google_pass_url": "GOOGLE_PASS_URL_GOES_HERE",
"user_joined_at": "2019-01-11T09:08:25Z"
}
}