Creating Custom Objects

ETaylor75
Member

I am trying to create a custom object using the site https://developers.hubspot.com/docs/api/crm/crm-custom-objects. I am using the “Create a new schema” section. I have filled out the required fields and applied the script it generated using our sandbox API. Below is the script the site generated minus the sandbox API key. This keep failing with the error message "This app hasn't been granted all required scopes to make this call. Read more about required scopes here: https://developers.hubspot.com/scopes", "All of the following scopes are required". Below is the error message in full.

curl --request POST \

  --url 'https://api.hubapi.com/crm/v3/schemas?hapikey={Sandbox API key}' \

  --header 'content-type: application/json' \

  --data '{

  "labels": {

    "singular": "Dealer Agreement",

    "plural": "Dealer Agreements"

  },

  "requiredProperties": [

    "name",

    "status"

  ],

  "searchableProperties": [

    "name"

  ],

  "secondaryDisplayProperties": [

    "status"

  ],

  "properties": [

    {

      "name": "name",

      "label": "Name",

      "isPrimaryDisplayLabel": true,

      "fieldType": "Single-line",

      "type": "string"

    },

    {

      "name": "status",

      "label": "Status",

      "type": "string",

      "fieldType": "Single-line"

    }

  ],

  "associatedObjects": [

    "COMPANY"

  ],

  "name": "dealer_agreement",

  "primaryDisplayProperty": "my_object_property",

  "metaType": "PORTAL_SPECIFIC"

}'

 

------------------------------------------------------------------------------------------------------------------------------------------------

 

HTTP 403

 

{

  "status": "error",

  "message": "This app hasn't been granted all required scopes to make this call. Read more about required scopes here: https://developers.hubspot.com/scopes.",

  "correlationId": "3492a393-a7e4-4330-beae-f845a6593ebf",

  "errors": [

    {

      "message": "All of the following scopes are required.",

      "context": {

        "requiredScopes": [

          "crm.objects.custom.write"

        ]

      }

    }

  ],

  "links": {

    "scopes": https://developers.hubspot.com/scopes

  },

  "category": "MISSING_SCOPES"

}

0 Upvotes

0 Replies

No replies on this post just yet

No one has replied to this post quite yet. Check back soon to see if someone has a solution, or submit your own reply if you know how to help! Karma is real.

Reply to post

Need help replying? Check out our Community Guidelines

0 Replies 0