ThingWorx Edge C SDK > Callback Function Return Codes
  
Callback Function Return Codes
The following table contains the acceptable return codes (msgCodeEnum) for all Property and Service callback functions. These codes are defined in src/api/twDefinitions.h. The callback functions are invoked as a result incoming requests from ThingWorx platform. The property and service callback function signatures are defined in src/api/twApi.h.
Return Code
Returned When
HTTP Client Error Status Codes
TWX_SUCCESS = 0x40
0x40 (2.00) Success. The request completes successfully.
TWX_BAD_REQUEST = 0x80
0x80 (4.00) Bad request. The HTTP request contains syntax errors, so the server cannot understand it. Modify the request before attempting it again.
TWX_UNAUTHORIZED
0x81 (4.01) Unauthorized. The request requires authentication. This error results from a failed login attempt — whether from credentials that were not valid or from the request being sent before authentication occurred.
TWX_BAD_OPTION
0x82 (4.02) Bad option. An option or a parameter for a function has a value that is not valid or is not spelled correctly (and so is not recognized).
TWX_FORBIDDEN
0x83 (4.03) Forbidden. ThingWorx platform is denying access to the requested resource. Check your permission settings on ThingWorx platform.
TWX_NOT_FOUND
0x84 (4.04) Not found. Anything is not found — a property, a service, a thing, a data shape, and so on.
TWX_METHOD_NOT_ALLOWED
0x85 (4.05) Method not allowed. The specified method is not allowed. Check the spelling and syntax of your code.
TWX_NOT_ACCEPTABLE
0x86 (4.06) Not acceptable.
TWX_PRECONDITION_FAILED = 0x8C
0x8C (4.12) Precondition failed. The precondition for the operation is not met.
TWX_ENTITY_TOO_LARGE
0x8D (4.13) Entity too large. An attempt is made to send a Property, or Service or Event parameter that is too large for ThingWorx platform to handle.
TWX_UNSUPPORTED_CONTENT_FORMAT = 0x8F
0x8F (4.15) Unsupported content format. An attempt is made to send a Property, or Service or Event parameter that has the wrong baseType as defined on ThingWorx platform.
HTTP Server Error Status Codes
TWX_INTERNAL_SERVER_ERROR = 0xA0
0xA0 (5.00) Internal server error. An error occurs on ThingWorx platform while processing this request.
TWX_NOT_IMPLEMENTED
0xA1 (5.01) Not implemented. ThingWorx platform may return this error if you attempt a function that is not implemented.
TWX_BAD_GATEWAY
0xA2 (5.02) Bad gateway. A gateway could be bad if it cannot communicate to the next component in the chain.
TWX_SERVICE_UNAVAILABLE
0xA3 (5.03) Service unavailable. The requested service is not defined. You could also use the TW_NOT_FOUND error code, but this one is more specific.
TWX_GATEWAY_TIMEOUT
0xA4 (5.04) Gateway timeout. If the application sends a request to ThingWorx platform and does not get a response within some amount of time, the service call results in this error. The amount of time is configurable.
TWX_WROTE_TO_OFFLINE_MSG_STORE
Wrote to offline message store. The message is not sent to ThingWorx platform, but instead is stored in the offline message store. The message will be delivered next time the websocket is connected.