The My Customers API is a demo API providing examples of some common RESTful concepts. It supports both XML and JSON content.
Many methods that return or accept data in the body of the message offer a choice of XML or JSON formats for the data. You can use the Content-Type header to inform the API what mediatype your application is sending it, and the Accept header to determine the mediatype the API will return to your application. Acceptable mediatypes are:
Request | Response |
---|---|
application/json | application/json |
application/xml | application/xml |
text/xml | text/xml |
application/x-www-form-urlencoded |
Many of the methods return a common set of status codes that are described in the following table.
Status Code | Description |
---|---|
200 OK | Successful request other than creation. |
201 Created | Successful create (add) request. |
400 Bad Request | Returned if the client sends invalid parameters or body content. |
401 Unauthorized | Authentication required. |
403 Forbidden | Client is unauthorized to perform the operation. Should be returned when the user doesn't have business permissions as well as any contract violations. |
404 Not Found | If a resource specified in the path, parameters, or body is not found. |
406 Unacceptable | Returned if the Accept header does not include the content type produced by the service. |
409 Conflict | Returned if a modification request is made on a resource that is in a state that can't support the modification. For example, executing a workflow action on a resource that is not applicable in the resource's current state. |
415 Unsupported Media Type | Returned if the request is using a media type not supported by the method. |
500 Internal server error | Business logic failure caused by something other than what is listed above. |
The Resource API methods are:
Method | Description |
---|---|
ListResources | Returns a list of all the Resource in the system. |
GetResource | Returns a single resource object. |
AddResource | Adds a new resource object to the system. |
DeleteResource | Removes a resource from the system. |
RenewToken | Updates a resource object, either in its entirety, or partially. |
What are you waiting for? Nike up and Just Do It!!