User Enrollment
Enrolls a user in a campaign (currently supported for social cause campaigns)
Headers
- Type: stringx
-pch -digest requiredThe signature for the API call
- Type: stringcache
-control - Type: stringAcceptrequired
Advertises which content types the client is able to understand
- Type: stringAuthorizationrequired
You may pass the access_token instead of the authentication_token in Online Ordering endpoints to authorize the request. It must be supplied as
Bearer ACCESS_TOKEN_GOES_HERE. - Type: stringUser
- Agent requiredFor details, see User Agent.
- Type: stringContent
- Type requiredSet this header to application/json.
Body
application/json
- Type: stringclientrequired
Client key of the business
- Type: integerFormat: int32item
_id requiredID of the campaign in which the user will be enrolled
- enumitem
_type const:social_cause_campaignrequiredType of the campaign in which the user will be enrolled. The currently supported type is
social_cause_campaign. - Type: stringauthentication
_token The authentication token of the user. You can retrieve this from the response of a successful sign-in API call or through the SSO process.
Responses
- application/json
- 400
Request Example for post/api/auth/user_enrollments
curl https://SERVER_NAME_GOES_HERE.punchh.com/api/auth/user_enrollments \
--request POST \
--header 'x-pch-digest: SIGNATURE_GOES_HERE' \
--header 'cache-control: no-cache' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer ACCESS_TOKEN_GOES_HERE' \
--header 'User-Agent: Punchh/OnlineOrder/1.0/Web/BrowserVersion/OS_Type' \
--header 'Content-Type: application/json' \
--data '{
"client": "CLIENT_GOES_HERE",
"authentication_token": "AUTHENTICATION_TOKEN_GOES_HERE",
"item_id": 1,
"item_type": "social_cause_campaign"
}'
[
"Successfully registered"
]