Skip to main content
Question

LeadConnector error: Raw request failed. Problem executing your request. Invalid JWT


 

its a action application in zapier i have used xero as an action app which is fetching new quotes from an organization and making it an object for each order i want to use api request(beta) inside lead connector to post that directly to my crm that creates an opportunity.   

33 replies

Super helpful. Very much appreciate the thorough response. +1 that the API V2 is used and that we can use the API Request action with it.

I have created a private-use app in the GHL developer marketplace. I have also coded a process into the authorization landing page for this app that creates custom values in GHL to store these tokens. Additionally, I have an automation in GHL that updates these tokens every day and pushes the updated tokens out to a table in Zapier automatically. Now if Zapier could get setup to use the new Oauth for GHL’s API v.2 these tokens would come in very handy. As-is I have found workaround through some private apps and webhooks to do most of what I need but native integrations are always preferred when available.

@TitanWashing Confirmed Zapier is using a private API for the integration. The API Request action will not work.

 

Only option is the webhook action. I think you basically need a way to generate and store the latest Oauth token and use that in your zapier webhook. Would be curious to hear whether you have created a simple way to generate and store these oAuth tokens.

@TitanWashing yep, you’re right -- I should have tested myself before responding here. Sorry about that.

 

Referencing the V1 endpoint returns: 

Domain did not match expected domain filter(s) `api.gohighlevel.com,services.leadconnectorhq.com`.

 

It looks like LeadConnector is denying calls to V1 endpoints. Using api.gohighlevel.com returns not found and services.leadconnectorhq.com is the V2 endpoint that requires the oAuth token.

 

What I’m not clear on is if LeadConnector is denying calls to V1 endpoints, then that implies the Zapier integration is using V2 for all of their current actions, no? If it’s using V2, then we shouldn’t be getting the Invalid JWT response when we use the API Request action is used. Only other scenario I can think of is Zapier <> LeadConnector have a private integration that still allows the V1 endpoints to be called.


 

Problem is, GHL’s API 1.0 has been sunset and is no longer supported. They (GHL) have advised to stop using 1.0. We really need Zapier to get onboard with 2.0. 

Hey all, I just got word back from Zapier that their app is referencing GHL’s API 1.0 (https://public-api.gohighlevel.com/#dac71866-cddd-48e9-ba77-99fd293594fa). Change your endpoints to those referenced in 1.0 and your API Request actions should work.

Thank you @Troy Tessalone 

 

@TitanWashing You should be able to accomplish that with the webhook action. Not much different than the API Request action. Use a zap (maybe code) to grab the token from whatever table you’re storing it in and then pass that to the webhook action.

 

The reason I’m personally not a fan of the webhook route is because it looks like you need to register a custom app with LeadConnector to be able to generate the oauth token. The appeal of the API Request action for me was that it’s supposed to handle the generation of the token for you automatically since the zap is persistently connected to the account/location you choose. I imagine zapier must have code under the hood that’s generating the token every 24hrs so that these leadconnector zaps work. There must be a breakdown somewhere of passing that token they are already generating to the API Request action. Thoughts?

Userlevel 7
Badge +14

@TitanWashing 

Feedback and feature requests can be submitted via a ticket to Zapier Support to be logged properly: https://zapier.com/app/get-help

It would be a nice feature to be able to turn off the auto auth-header (per zap of course) and be able to just grab our latest token from our table where it’s stored and updated daily. The issue comes in when the 2 headers are conflicting with each other. 

Userlevel 7
Badge +14

@prodo 

Tickets can be opened with Zapier Support: https://zapier.com/app/get-help

Hi @Troy Tessalone, to piggy back off of @TitanWashing’s response -- the action should be dynamically taking the latest authentication header from the account that is connected to the zap, but it seems like it’s not, so an expired auth token (if any at all) is being passed to the endpoint which is causing the failure.

 

I can replicate the issue. Is there a formal process to have a ticket submitted for zapier to look at this?

Userlevel 7
Badge +14

@TitanWashing 

Is there a way to turn off the automatic authentication header in Zapier?

You would have to use a custom API request via:

@Troy Tessalone I have been dealing with this same exact issue. The problem is, Zapier can’t automatically provide the authentication Header as that token expires / changes every 24 hours. I assume Zapier is just providing the API key in that header which is conflicting with the Oauth Acess Token that the API call is actually looking for. Is there a way to turn off the automatic authentication header in Zapier?

Userlevel 7
Badge +14

@Talha1122 

If you need help, consider hiring a Certified Zapier Expert from the directory: https://zapier.com/experts

 

Looks like you have a line break after your Version value (2021-07-28), which should be removed.

 

This is not a valid Body structure as defined by the API endpoint docs:

 

{
"pipelineId": "VDm7RPYC2GLUvdpKmBfC",
"locationId": "ve9EPM428h8vShlRW1KT",
"name": "First Opps",
"pipelineStageId": "7915dedc-8f18-44d5-8bc3-77c04e994a10",
"status": "open",
"contactId": "mTkSCb1UBjb5tk4OvB69",
"monetaryValue": 220,
"assignedTo": "082goXVW3lIExEQPOnd3",
"customFields": [
{
"id": "6dvNaf7VhkQ9snc5vnjJ",
"key": "my_custom_field",
"field_value": "9039160788"
}
]
}

 

 

Badge

 

Userlevel 7
Badge +14

@Talha1122 

Including this note:

NOTE: For us to have current context, you will need to post updated screenshots with how your Zap steps are configured in EDIT mode, along with encountered errors.

Badge

Failed to create a http request in LeadConnector

Raw request failed. Problem executing your request: 2021-07-28 is not a legal HTTP header value

Userlevel 7
Badge +14

@Talha1122 

The feedback was to only remove the Authorization header.

Try removing the Authorization header as it is already included per the section indicator.

 

API docs indicate 2 Headers are required.

Zapier should automatically include the Authorization Header as indicated.

You would need to configure the Version Header.

 

NOTE: For us to have current context, you will need to post updated screenshots with how your Zap steps are configured in EDIT mode, along with encountered errors.

 

 

Badge

Failed to create a http request in LeadConnector

Raw request failed. Problem executing your request: version header was not found.

got this issue when i removed all headers and when i used that 2021-07-28 it says not a valid header

Userlevel 7
Badge +14

@Talha1122 

Try removing the Authorization header as it is already included per the section indicator.

 

Badge

here is the link    
https://highlevel.stoplight.io/docs/integrations/802093aa63900-create-opportunity

Userlevel 7
Badge +14

@Talha1122 

This is the API endpoint link, but it is not the link to the API endpoint documentation that shows the requirements for the API endpoint request, such as method, headers, parameters, etc.

 

api endpoint used.             https://services.leadconnectorhq.com /opportunities/

Userlevel 7
Badge +14

@Talha1122 

The mapped variables in the Body are invalid as indicated by the ( ! ).

You would need to select those fro a previous Zap step.

Help article about configuring Zap action steps: https://zapier.com/help/create/basics/set-up-your-zap-action

Reference about custom pill mapping:

 

Badge

 

api endpoint used.             https://services.leadconnectorhq.com /opportunities/

Userlevel 7
Badge +14

@Talha1122 

For us to have current context about the error, post updated screenshots with how your Zap step is now configured.

Also, link to the app API endpoint documentation you used to configure the Zap step.

Reply