9/5/2023 0 Comments Basecamp 3![]() Plan ahead to gracefully handle the failure modes that API backpressure will exert on your integration. Consult the Retry-After response header to determine how long to wait (in seconds) before retrying the request. We return a 429 Too Many Requests response when you've exceeded a rate limit. We recommend baking graceful 5xx and 429 retries into your integration from the beginning so errors are handled automatically. Handling errorsĪPI clients must expect and gracefully handle transient server errors and rate limits. If the resource hasn't changed since your last request, you'll get a 304 Not Modified response with no body, saving you the time and bandwidth of sending something you already have. On subsequent requests, submit them back to us as If-None-Match and If-Modified-Since, respectively. When you first request a resource, store these values. Most API responses will include an ETag or Last-Modified header. You must use HTTP freshness headers to speed up your application and lighten the load on our servers. The Basecamp 4 API also provides the X-Total-Count header, which displays the total number of resources in the collection you are fetching. If the Link header is blank, that's the last page. Here's an example response header from requesting the third page of messages: ![]() Follow this convention to retrieve the next page of data-please don't build the pagination URLs yourself! The Basecamp 4 API follows the RFC5988 convention of using the Link header to provide URLs for the next page. In most cases, we use a geared pagination ratio with 15 results on page 1, 30 on page 2, 50 on 3, and then 100 on 4 and above. The number of requests that'll appear on each page is variable. Most collection APIs paginate their results. You'll receive a 415 Unsupported Media Type response code if you don't include the Content-Type header. Alternatively you can send Accept: application/json. This means that you have to send the Content-Type header Content-Type: application/json charset=utf-8 when you're POSTing or PUTing data into Basecamp. The style is no root element and snake_case for object keys.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |