APIs & Integrations

Help_sq
Membre

Workflow API vague error messages (Internal error)

I am experiencing some strange occurrences with the workflows API, specifically, I am unable to POST a new workflow action most times I've tried, even when the payload is the exact same. I did first delete the created action via the DELETE endpoint before trying again with the exact same payload. I currently have one action created but here is the payload I am currently trying that keeps failing:

 

 

const definitionResponse = await axios.post(
            "https://api.hubapi.com/automationextensions/v1/definitions",
            {
                integrationAppId: <<redacted>>,
                extensionName: "Create a Charge",
                webhookUrl:
                    <<redacted>>,
                fieldMetadata: [
                    {
                        label: "Product Name",
                        key: "product_name",
                        fieldType: "TEXT",
                        values: [
                            {
                                type: "STATIC_VALUE",
                                allowsMergeTags: true,
                            },
                        ],
                    },
                    {
                        label: "Amount",
                        key: "amount",
                        fieldType: "NUMBER",
                    },
                    {
                        label: "Subscription Plan",
                        key: "subscription_plan",
                        fieldType: "SELECT",
                        values: [
                            {
                                type: "STATIC_VALUE",
                                options: [
                                    {
                                        label: "U.S. Dollar",
                                        displayOrder: 1,
                                        hidden: false,
                                        readOnly: true,
                                        doubleData: null,
                                        description: null,
                                        value: "usd",
                                        text: "U.S. Dollar",
                                    },
                                    {
                                        label: "Canadian Dollar",
                                        displayOrder: 2,
                                        hidden: false,
                                        readOnly: true,
                                        doubleData: null,
                                        description: null,
                                        value: "cad",
                                        text: "Canadian Dollar",
                                    },
                                    {
                                        label: "Euro",
                                        displayOrder: 2,
                                        hidden: false,
                                        readOnly: true,
                                        doubleData: null,
                                        description: null,
                                        value: "eur",
                                        text: "Euro",
                                    },
                                ],
                            },
                        ],
                    },
                    {
                        label: "<<redacted>> API Key",
                        key: "api_key",
                        fieldType: "TEXT",
                        values: [
                            {
                                type: "STATIC_VALUE",
                                allowsMergeTags: true,
                            },
                        ],
                    },
                ],
            },
            {
                params: {
                    hapikey: "<<redacted>>",
                    applicationId: <<redacted>>,
                },
            },
        )

 

0 Votes
3 Réponses
Help_sq
Membre

Workflow API vague error messages (Internal error)

@Teun My apologies for not including this earlier but this is the response data 

{
  status: 'error',
  message: 'internal error',
  correlationId: 'c34bc6e0-f0dd-40ed-a91a-fdd8eebad6a1'
}
0 Votes
dennisedson
Équipe de développement de HubSpot
Équipe de développement de HubSpot

Workflow API vague error messages (Internal error)

@Teun , anything jump out to you here?

0 Votes
Teun
Expert reconnu | Partenaire solutions Diamond
Expert reconnu | Partenaire solutions Diamond

Workflow API vague error messages (Internal error)

Hi @Help_sq ,

 

What kind of errors do you get when you try to POST this request? You should be able to get some detailed errors using Axios. Could you try to give us some logs?



Learn more about HubSpot by following me on LinkedIn or YouTube

Did my answer solve your issue? Help the community by marking it as the solution.