We’ve been getting lots of great feed back about our API. There are several projects that have been using it and we’ve been working with them to answer their questions and solve some problems that they have been running into.
In our latest release we’ve made a few adjustments to how the API works. None of these changes should break compatibility.
Reduced API Rate Limit Penalty
We had a penalty included in our API for when an application went over their call limit. We had found that this penalty was too harsh and we’ve reworked it to allow applications using our API to hit the call limit occasionally without penalizing them.
Return 503 When Over Rate Limit
Previously we had been returning a 500 error when an application went over it’s call limit. We’ve changed that to a 503 Service Unavailable error as that better reflects the error.
JSON input and output
We’ve also been working on adding JSON input and output for requests. Previously we could output JSON, but now we can accept JSON for requests that require a request body.
Disabled WWW-Authenticate header for AJAX Requests
If you are sending an AJAX request we will no longer be sending the WWW-Authenticate header as this causes UI issues with browsers. All other clients will still receive the WWW-Authenticate header when their request could not be authenticated.
Setting a Default Limit on Listing Requests
Previously we did not page results by default. This was causing issues with very large result sets. Now listing requests (such as requesting all items) will by default return 100 objects per request. This behavior can be over-ridden using the limit and offset query parameters (see the API search manual page: https://manual.merchantos.com/index.php/API_Searching). We are also returning the total count of objects, the current offset and limit for a request as attributes on the outer object tag when we automatically limit a request.
Tagging
We have added the ability to write tags through our API. Objects supporting tags (currently only Items) will have a Tags element containing the tags on the object if there are any. The count of the tags will be returned as an attribute of the Tags element.
Tags can be added to an Object by adding xml similar to below:
foobar
The tag does not have to already exist in the account you are accessing, it will be generated when your object is submitted.
All Tags can be accesses through the new Account/<AccountNumber>/Tag endpoint. This will show you how many tags there are as well as what objects are associated with that tag.
Bug fix to IN queries
We fixed a bug that was preventing queries with the IN search operator from executing properly. Queries like the following should now execute:
https://api.merchantos.com/Account//Item?itemID=IN,[2,4,6,8]
More Improvements to Come!
We’re open to your feed back. If you have any questions about the changes we’re introducing please feel free to contact us. If you are having a problem with our API let us know and we will work with you to resolve it. Thanks again to all of the developers using our API for their valuable feedback. We’re working on even more improvements and we will post again when they are released.