A. API Response Codes
| # | Description | Code |
|---|---|---|
| 1 | OK | 200 |
| 2 | BAD REQUEST | 400 |
| 3 | UNAUTHORIZED | 401 |
| 4 | FORBIDDEN | 403 |
| 5 | NOT FOUND | 404 |
| 6 | INVALID FIELDS | 422 |
| 7 | SERVER ERROR | 500 |
| 8 | SERVICE NOT AVAILABLE | 503 |
B. API Error Codes
1. General parameter validation
| # | Used For | Code | Sub-code(Optional) | Error |
|---|---|---|---|---|
| 1 | App Error/Exception | 608 | Internal Application Error | |
| 2 | Duplicate Enrollment | 612 | Phone number is already enrolled in the last 60 minutes | |
| 3 | Invalid Parameters | 609 | <FIELD> is not a valid column | |
| 4 | Mandatory Value Missing | 615 | A/B - Field/Value for optional required fields |
<FIELD> is a required parameter OR n <FIELD> required parameter, value should not be empty. |
| 5 | Member and Group both required | 619 | A/B - Member/Group Number | <FIELD1> is required when <FIELD2> is provided |
| 6 | Memberid Used For Other Patient | 616 | MemberID already delivered to a different patient | |
| 7 | Missing Authentication Parameters | 620 | A/B - User/Pass | Authentication failed (<FIELD-INFO> is not provided) |
| 8 | Inactive campaign | 621 | This is an unauthorized request for a terminated/non-exists program. |
2. Field validation if no general code-B.1 match found
| # | Field | Code |
|---|---|---|
| 1 | MedCode | 600 |
| 2 | MedCode Length | 601 |
| 3 | Mobile Id | 602 |
| 4 | Member Id | 603 |
| 5 | Trigger | 604 |
| 6 | Sub Med Code | 605 |
| 7 | Invalid Trigger | 606 |
| 8 | Care Giver One Digit | 607 |
| 9 | Shortcode Not Found | 610 |
| 10 | Invalid Email | 611 |
| 11 | Group Number | 613 |
| 12 | Trigger Not Found | 614 |
| 13 | Pre-Procedure Invalid Request | 617 |
| 14 | Pre-Procedure Invalid WEBYES Request | 618 |
3. Error List
| # | Description |
|---|---|
| 1 | The server cannot or will not process the request due to an apparent client error. Response body will include detailed description of the error. |
| 2 | Authentication failed (No such username or password). |
| 3 | Authentication failed (user/password not provided) |
| 4 | Authentication failed (username is not provided) |
| 5 | Authentication failed (password is not provided) |
| 6 | The resource you tried to locate could not be found or does not exist. |
| 7 | <Field> is a required parameter |
| 8 | <Field> is a required parameter, value should not be empty. |
| 9 | <Field> is not a valid column |
| 10 | MedCode must be a 3-characters code |
| 11 | MobileID must be a valid 10 digit phone number |
| 12 | MobileID must be a valid phone number less than 20 digits |
| 13 | MobileID must be digits except for + sign |
| 14 | MemberID is a required parameter |
| 15 | MemberID length should be between 9-12 digits |
| 16 | Trigger length cannot be greater than 20 characters |
| 17 | Trigger is not associated with any active Program |
| 19 | Invalid Trigger, one of EML, WEB, IVR, APP should be part of the trigger |
| 20 | SubMedCode length cannot be greater than 12 characters |
| 21 | Internal Application Error |
| 22 | The request has invalid parameters |
| 23 | Short code could not be found |
| 24 | Email address is Invalid |
| 25 | Phone number is already enrolled in the last 60 minutes |
| 26 | Invalid Trigger |
| 27 | response param value missing |
| 28 | Date format is incorrect |
| 29 | optional2 is a required parameter |
| 30 | optional2 must be a valid digit |
| 31 | MDM ID length should be between 9-12 digits |
| 32 | MemberID already delivered to a different patient |
| 33 | Member Id is required when Group Number is provided |
| 34 | Group Number is required when Member Id is provided |
| 35 | The request don't have all required parameters/value |
| 36 | Request received for cancelled/stopped enrollment |
| 37 | WEBYES received for completed/cancelled/stopped enrollment |
Response With Error Sample
Example 1:
HTTP/1.1 401 UNAUTHORIZED
Content-Type: application/json
{
"code" : 401,
"error_type" : "UNAUTHORIZED",
"errors" : [
"Authentication failed (No such username or password is used with provided trigger/medcode for campaign)."
]
}
Example 2:
HTTP/1.1 400 BAD_REQUEST
Content-Type: application/json
{
"code" : 400,
"error_type" : "BAD REQUEST",
"errors" : [
"The request sent to the server is invalid or corrupted."
]
}
Example 3:
HTTP/1.1 422 INVALID_FIELDS
Content-Type: application/json
{
"code" : 422,
"error_type" : "INVALID FIELDS",
"errors" : [
"616: MemberID already delivered to a different patient",
"614: Trigger not found"
]
}