APIs & Integrations

MSilva51
Member

How to know the companies that get error

POST '/crm/v3/objects/companies/batch/create'

How to know the companies that got error during creation of a batch of companies in this endpoint?

I'd like to know the properties of the companies that get error in the creation process to save they in logs registration, but seeing the JSON response of http code 207 I didn't understand where I can get these informations.

0 Upvotes
3 Replies 3
RMones
Contributor | Platinum Partner
Contributor | Platinum Partner

How to know the companies that get error

Hi @MSilva51 ,

 

Did you log the response of that call? 
Whats in the repsonse body?

You can also check the request in you App portal; Maybe you can get there more information about your call.

https://legacydocs.hubspot.com/docs/faq/api-request-monitoring

 

Regards Ronald

MSilva51
Member

How to know the companies that get error

It's not a especific response, but the response when you got 207 HTTP response. The V3 of the API shows in https://developers.hubspot.com/docs/api/crm/companies in the "Create a batch of companies" part the following JSON as response in 207 HTTP status code:

 

{
  "status": "PENDING",
  "results": [
    {
      "id": "512",
      "properties": {
        "city": "Cambridge",
        "createdate": "2019-10-30T03:30:17.883Z",
        "domain": "biglytics.net",
        "hs_lastmodifieddate": "2019-12-07T16:50:06.678Z",
        "industry": "Technology",
        "name": "Biglytics",
        "phone": "(877) 929-0687",
        "state": "Massachusetts"
      },
      "createdAt": "2019-10-30T03:30:17.883Z",
      "updatedAt": "2019-12-07T16:50:06.678Z",
      "archived": false
    }
  ],
  "numErrors": 0,
  "errors": [
    {
      "status": "string",
      "id": "string",
      "category": {
        "httpStatus": "CONTINUE",
        "name": "string"
      },
      "subCategory": {},
      "message": "string",
      "errors": [
        {
          "message": "string",
          "in": "string",
          "code": "string",
          "subCategory": "string",
          "context": {
            "missingScopes": [
              "scope1",
              "scope2"
            ]
          }
        }
      ],
      "context": {
        "additionalProp1": [
          "string"
        ],
        "additionalProp2": [
          "string"
        ],
        "additionalProp3": [
          "string"
        ]
      },
      "links": {
        "additionalProp1": "string",
        "additionalProp2": "string",
        "additionalProp3": "string"
      }
    }
  ],
  "requestedAt": "2022-03-17T14:07:54.050Z",
  "startedAt": "2022-03-17T14:07:54.050Z",
  "completedAt": "2022-03-17T14:07:54.050Z",
  "links": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  }
}

 

You can see the erros, but in this exaple that the documentation gives to us thre's not explanation about what these informations means. Eg.: What is this missingScope? I'd like to know what each part of this JSON means. 

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

How to know the companies that get error

@RMones , do you have some advice on this?

0 Upvotes