I’m writing because I’ve been using the hubspot api for batch operations and I’m confused with some scenarios with them. Sometimes when in a batch of contacts there’s at least one with wrong email, I get a 400 error code and none of the contacts in the batch got created, but in some cases, which I haven’t been able to recreate on postman to have 100% certainty, it returned a 207 with, for example, 29 results with correct data out of the 30 contacts in the original batch.
I’d like to know exactly when the api returns 207 and what it looks like in a response.
I’m writing because I’ve been using the hubspot api for batch operations and I’m confused with some scenarios with them. Sometimes when in a batch of contacts there’s at least one with wrong email, I get a 400 error code and none of the contacts in the batch got created, but in some cases, which I haven’t been able to recreate on postman to have 100% certainty, it returned a 207 with, for example, 29 results with correct data out of the 30 contacts in the original batch.
I’d like to know exactly when the api returns 207 and what it looks like in a response.
I hope you can help me out, thanks in advance.
The 207 HTTP status code is utilized in situations where a server sends a multi-status response, indicating that some parts of the requested operation were successful while others encountered issues. This is particularly relevant in batch operations, such as creating multiple contacts simultaneously through HubSpot’s API.
When a batch request is made and processed, the 207 status code can signify that, for example, most contacts were successfully created but a few failed due to errors like invalid email addresses. The response body accompanying the 207 status code typically contains detailed information about each request within the batch, including the status code, a message explaining the outcome, and potentially additional data pertinent to each request.
Developers must handle 207 responses appropriately, parsing the response body to identify successful and unsuccessful operations and taking necessary actions based on the provided information.