API Response Codes

API calls return a http response code, and XML message. XML consists of a success or failure indicator as well as detailed messages, besides the actual data returned by the API.  

Http Response Codes

SC_OK - 200

SC_FORBIDDEN - 403

SC_UNAUTHORIZED - 401

SC_NOT_FOUND - 404

XML Response Code

xml response code is returned in the root level xml node in the response. E.g. <response code="0">

SUCCESS - 0

FAILURE - -1

 

Message Code

Message code is contained inside the msgs element within response. Here is an example

<msgs>
      <msg>
         <code>0</code>
         <value>
            <![CDATA[Success]]>
         </value>
      </msg>
   </msgs>

A common success code used by all service/methods is - 

SUCCESS - 0

Besides this, each service method uses different codes as per the functionality provided by that service/method.

User Service

GENERIC_ERROR - 0026
NOT_FOUND - 0004
USERNAME_NOT_UNIQUE - 0017
EMAIL_NOT_UNIQUE - 0209
USER_ADDED_SUCCESSFULLY - 0018
USER_UPDATED_SUCCESSFULLY - 0172
ACTIVATED_SUCCESSFULLY - 0092
INACTIVATED_SUCCESSFULLY - 0093
MERGED_SUCCESSFULLY - 0224
GRP_USER_ADD_SUCCESS - 0031
GRP_USER_DEL_SUCCESS - 0032
ORIGIN_SITE_UPDATED_SUCCESSFULLY - 0212

Group Service

GRP_USER_ADD_SUCCESS - 0031
GRP_USER_DEL_SUCCESS - 0032
GENERIC_ERROR - 0026
NOT_FOUND - 0004
GROUP_UPDATED_SUCCESSFULLY - 0211
UNSUPPORTED_OP - 0210
GROUP_UPDATED_SUCCESSFULLY - 0211
INVALID_GROUP_TEMPLATE - 0219
INVALID_PATH - 0220
GROUP_CREATED_SUCCESSFULLY - 0218
GROUP_DELETED_SUCCESSFULLY - 0221

Catalog Service

GROUP_CONTENT_NOT_VISIBLE - 0192

Connect Service

CONNECT_NOT_SUCCESSFUL - 0154
SESSION_NOT_VALID - 0174
CONNECT_SUCCESSFUL - 0152

Enrollment Service

GENERIC_ERROR - 0026
PM_UPDATED_SUCCESSFULLY - 0226
COURSE_SESSION_SUBSCRIBED - 0153
EVENT_SUBSCRIBED - 0193
PROGRAM_SESSION_SUBSCRIBED - 0194

Report Service

GENERIC_ERROR - 0026

Coupon Service

INVALID_PATH - 0220
COUPON_CREATED_SUCCESSFULLY - 0222
GENERIC_ERROR - 0026
DELETED_SUCCESSFULLY - 0089
COUPON_UPDATED_SUCCESSFULLY - 0223

Event Service

COURSE_SESSION_SUBSCRIBED - 0153
GENERIC_ERROR - 0026
GROUP_NOT_VISIBLE - 0063
GROUP_EXPIRED - 0076

Signup Service

GENERIC_ERROR - 0026
USER_ADDED_SUCCESSFULLY - 0018

Signin Service

ACCOUNT_INACTIVE - 0002

Signup Service

GENERIC_ERROR - 0026
USER_ADDED_SUCCESSFULLY - 0018

Forgot Password Service

CONNECT_NOT_SUCCESSFUL - 0154
GENERIC_ERROR - 0026
PASSWORD_RESET_NOT_ALLOWED - 0151
PASSWD_EMAILED - 0006

 

 

 

 

 

 

 


Rating: