Rest API: Phone Number

Get Started. It's Free
or sign up with your email address
Rocket clouds
Rest API: Phone Number by Mind Map: Rest API: Phone Number

1. Common Error Codes

1.1. If token not provided or expired 401 Error code

1.1.1. "message": "Authorization has been denied for this request."

1.2. If cusomerId is not supplied the error 405 Method Not Allowed occurs

1.2.1. standard framework error

1.3. If sending more requests than is allowed then 429: Too many requests

1.3.1. Configuration. To be confirmed with Dev

1.3.2. "message": "You have exceeded the maximum limit of request allowed. Please try your request again in a moment."

1.4. If client does not have permission to business that customer belongs to then 403: Forbidden

1.4.1. { "errorCode": "access_denied", "message": "Unable to process this request as you do not have access to the customer associated to this request." }

1.5. 500: Internal Server Error Lock database to test

1.6. 503: Service Unavailable Turn off CustomerServices in Application Pool to Test

2. Add Phone Number

2.1. Mandatory fields

2.1.1. phoneName

2.1.1.1. phoneName value is not supplied / space provided as a value

2.1.1.1.1. 400 Bad request

2.1.1.1.2. { "field":"phoneNumber", "message":"Name is required." }

2.1.1.2. phoneName value exceeds 50 characters (51)

2.1.1.2.1. 400 Bad request

2.1.1.2.2. { "field":"name", "message":"Name must not exceed 40 characters." }

2.1.2. countryCode

2.1.2.1. countryCode value is not supplied / space provided as a value

2.1.2.1.1. 400 Bad request

2.1.2.1.2. { "field":"countryCode", "message":"CountryCode is required." }

2.1.2.2. countryCode value exceeds 4 characters (5)

2.1.2.2.1. 400 Bad request

2.1.2.2.2. { "field":"countryCode", "message":"CountryCode must not exceed 4 characters." }

2.1.3. phoneNumber

2.1.3.1. phoneNumber value is not supplied / space provided as a value

2.1.3.1.1. 400 Bad request

2.1.3.1.2. { "field":"phoneNumber", "message":"PhoneNumber is required." }

2.1.3.2. phoneNumber value exceeds 75 characters (76)

2.1.3.2.1. 400 Bad request

2.1.3.2.2. { "field":"phoneNumber", "message":"PhoneNumber must not exceed 75 characters." }

2.1.3.3. provided phoneNumber already exists the same type (regardless of phone format)

2.1.3.3.1. 400 Bad request

2.1.3.3.2. { "field":"phoneNumber", "message":"PhoneNumber provided already exist." }

2.1.4. phoneType

2.1.4.1. type value is not supplied / space provided as a value

2.1.4.1.1. 400 Bad request

2.1.4.1.2. { "field":"phoneType", "message":"PhoneType is required." }

2.1.4.2. type value is not from the list Emergency, Home, Fax, Mobile, Work

2.1.4.2.1. 400 Bad request

2.1.4.2.2. { "field":"phoneType", "message":"PhoneType is invalid." }

2.2. Optional fields

2.2.1. areaCode

2.2.1.1. areaCode value exceeds 4 characters (5)

2.2.1.1.1. 400 Bad request

2.2.1.1.2. { "field":"areaCode", "message":"AreaCode must not exceed 4 characters." }

2.2.2. isPrimary

2.2.2.1. provided value is not true or false

2.2.2.1.1. don't care, will be handled in front end

2.2.2.2. provided value is true

2.2.2.2.1. existing phoneNumber is false

2.2.2.2.2. new created is true

2.2.2.3. provided value is false

2.2.2.3.1. existing phoneNumber is true

2.2.2.3.2. new created is false

2.3. Checking DB and API values length for consistency

2.3.1. API and DB should have the same field length

2.4. Successful request: Response checks

2.4.1. Response code is 201

2.4.2. Response includes all provided values

2.4.3. phoneNumber

2.4.3.1. phoneNumberId returns

2.4.3.1.1. DB has a record with the same phoneNumberId and provided values

2.4.4. Audit record created with full request

3. Update Phone Number

3.1. Mandatory fields

3.1.1. phoneName

3.1.1.1. phoneName value is not supplied / space provided as a value

3.1.1.1.1. 400 Bad request

3.1.1.1.2. { "field":"phoneNumber", "message":"Name is required." }

3.1.1.2. phoneName value exceeds 50 characters (51)

3.1.1.2.1. 400 Bad request

3.1.1.2.2. { "field":"name", "message":"Name must not exceed 50 characters." }

3.1.2. countryCode

3.1.2.1. countryCode value is not supplied / space provided as a value

3.1.2.1.1. 400 Bad request

3.1.2.1.2. { "field":"countryCode", "message":"CountryCode is required." }

3.1.2.2. countryCode value exceeds 4 characters (5)

3.1.2.2.1. 400 Bad request

3.1.2.2.2. { "field":"countryCode", "message":"CountryCode must not exceed 4 characters." }

3.1.3. phoneNumber

3.1.3.1. phoneNumber value is not supplied / space provided as a value

3.1.3.1.1. 400 Bad request

3.1.3.1.2. { "field":"phoneNumber", "message":"PhoneNumber is required." }

3.1.3.2. phoneNumber value exceeds 75 characters (76)

3.1.3.2.1. 400 Bad request

3.1.3.2.2. { "field":"phoneNumber", "message":"PhoneNumber must not exceed 75 characters." }

3.1.3.3. provided phoneNumber already exists the same type (regardless of phone format)

3.1.3.3.1. 400 Bad request

3.1.3.3.2. { "field":"phoneNumber", "message":"PhoneNumber provided already exists." }

3.1.4. phoneType

3.1.4.1. type value is not supplied / space provided as a value

3.1.4.1.1. 400 Bad request

3.1.4.1.2. { "field":"phoneType", "message":"PhoneType is required." }

3.1.4.2. type value is not from the list Emergency, Home, Fax, Mobile, Work

3.1.4.2.1. 400 Bad request

3.1.4.2.2. { "field":"phoneType", "message":"PhoneType is invalid." }

3.1.4.3. type value is deprecated Previous, Clubware, Clubware Phone

3.1.4.3.1. 400 Bad request

3.1.4.3.2. { "field":"phoneType", "message":"PhoneType is invalid." }

3.2. Optional fields

3.2.1. areaCode

3.2.1.1. areaCode value exceeds 4 characters (5)

3.2.1.1.1. 400 Bad request

3.2.1.1.2. { "field":"areaCode", "message":"AreaCode must not exceed 4 characters." }

3.2.2. isPrimary

3.2.2.1. provided value is not true or false

3.2.2.1.1. don't care, will be handled in front end

3.2.2.2. original value is true

3.2.2.2.1. supplied true

3.2.2.2.2. supplied false / not supplied

3.2.2.3. original value is false

3.2.2.3.1. supplied false / not supplied

3.2.2.3.2. supplied true

3.3. Successful request: Response checks

3.3.1. Response code is 201

3.3.2. Response includes all provided values

3.3.3. phoneNumber

3.3.3.1. phoneNumberId returns

3.3.3.1.1. DB has a record with the same phoneNumberId and provided values

3.3.4. Audit record created with delta

3.3.4.1. if there is no delta audit record doesn't create

3.4. Not successful request

3.4.1. Trying to update business phoneNumber

3.4.1.1. 404 Not found

3.4.1.2. { "message": "The requested resource could not be found." }

3.4.2. Trying to update invalid phoneNumber

3.4.2.1. 404 Not found

3.4.2.2. { "message": "The requested resource could not be found." }

4. Delete Phone Number

4.1. Successful request: Response checks

4.1.1. Response code is 200

4.1.2. { "message":"Phone number successfully deleted" }

4.1.3. Audit record created

4.1.4. Contacts table doesn't have the phone

4.2. Validation

4.2.1. Provided phoneId doesn't exist

4.2.1.1. 404 Not Found

4.2.1.2. { "message":"The requested resource could not be found." }

4.2.2. Attempt to delete Primary phone number

4.2.2.1. 400 Bad Request

4.2.2.2. { "field"phoneNumberId", "message":"Deletion of Primary phone number is not allowed." }

4.2.3. Attempt to delete Invalid PhoneNumber

4.2.3.1. 404 Not Found

4.2.3.2. { "message":"The requested resource could not be found." }

5. Get Phone Number / Get Phone Numbers

5.1. phoneNumberId provided

5.1.1. Provided phoneNumberID exists in the DB and matches with CustomerID

5.1.1.1. Response 200

5.1.1.2. Response has phoneNumberId

5.1.1.3. All data is DB returned correctly

5.1.2. Provided phoneNumberID exists but doesn't match to customerID provided

5.1.2.1. 404 Error

5.1.2.2. { "message":"The requested resource could not be found." }

5.1.3. Provided phoneNumberID with deprecated phoneType

5.1.3.1. Response 200

5.1.3.2. Response has phoneNumberId

5.2. phoneNumberId is not provided

5.2.1. Response 200

5.2.2. Response has all phoneNumbers configured for the customer with their IDs

5.2.3. Populate all the list regardless if phoneType is deprecated

5.2.4. NextCursor and Limit not provided

5.2.4.1. If DB has more 50 records the NextCursor will be provided in the request

5.2.4.2. If DB has less than 50 records only phoneNumbers will be returned

5.2.5. NextCursor and Limit are provided

5.2.5.1. Response has records based on limit

5.2.5.2. The response returns the next cursor

5.2.5.3. Request from the next cursor returns correct phoneNumbers

6. Common checks

6.1. space before and after the value

6.1.1. will be trimmed