Phone Number Capture
PUT/client/users/:correlation_id/profile/phonenumber
-
This API captures a phone number for a member account.
-
The status parameter in the request indicates the user’s phone number prompt preference.
-
Valid status in the request includes: deferred, accepted, and declined.
Request
Body
| Attribute | Definition | Format | Notes |
|---|---|---|---|
| phoneNumber | The phone number to be associated with an account | String. For a status of "accepted", a valid phone number (not null) must be provided. | For a status of "deferred", the phone number must be undefined (with no value). For a status of "declined", the phone number value must be null. |
| status | The phone number prompt preference | Enum: "deferred", "accepted", or "declined" | "deferred" means "ask me another time"; "declined" means the member refused to opt in to SMS communications |
Response
| Attribute | Definition | Format | Notes |
|---|---|---|---|
| message | Shows that a phone number has been set | String | "Phone number option updated." |
Error Responses
| statusCode | errorMessage | errorCode | Definition |
|---|---|---|---|
| 400 Bad Request | Phone number is required. | INVALID_REQUEST | For status 'accepted' there must be a phoneNumber attribute in the request that has a valid phone number (for instance, (123) 456-7890). |
| 400 Bad Request | Phone number is required. | INVALID_REQUEST | For status 'declined' there must be a phoneNumber attribute in the request that has a value of null. |
| 400 Bad Request | Phone number is required. | INVALID_REQUEST | For 'accepted' status, the value of the phoneNumber attribute must be a valid phone number (for instance, in the format (123) 456-7890). |
| 400 Bad Request | Invalid phone number for this status. | INVALID_REQUEST | For 'declined' status, the value of the phoneNumber attribute must be null. |
| 400 Bad Request | Phone number not expected when status is deferred. | INVALID_REQUEST | No phoneNumber attribute with any value can be included in the request for 'deferred' status. |
| 400 Bad Request | Phone number not expected when status is deferred. | INVALID_REQUEST | No phoneNumber attribute with any value can be included in the request for 'deferred' status. |
| 400 Bad Request | Status is mandatory and required to be non-emtpy. | INVALID_REQUEST | status attribute with valid value ('accepted", 'deferred', or 'declined') must be included in request. |
| 400 Bad Request | Invalid status. | INVALID_REQUEST | status attribute value must be 'accepted', 'deferred', or 'declined'. |
| 400 Bad Request | Invalid phone number format. | INVALID_REQUEST | phoneNumber must have valid phone number value (for instance, (123) 456-7890). |
Request
Responses
- default
200 - Phone Number Capture - Accepted