Getting error 400: The request failed due to failure of a previous request

:bullseye: What is your goal?

My goal is to get the list of tags in the RPC

:thinking: What is the problem?

Getting the
The request failed due to failure of a previous request. 400

:test_tube: What have you tried so far?

I have tried in my api in Postman, everything is working fine
But in the make it returns an unauthorised request, which means a token error

here is my Connection code

{
ā€œurlā€: ā€œmyapi.comā€,
ā€œmethodā€: ā€œGETā€,

ā€œheadersā€: {
ā€œAuthorizationā€: ā€œBasic {{base64(parameters.email + ā€˜:’ + parameters.password)}}ā€,
ā€œAcceptā€: ā€œapplication/jsonā€
},

ā€œresponseā€: {
ā€œaccessTokenā€: ā€œ{{body.accessToken}}ā€,

"metadata": {
  "type": "text",
  "value": "{{body.email}}"
},

"error": {
  "message": "[{{statusCode}}] {{body.message}}"
}

},

ā€œlogā€: {
ā€œsanitizeā€: [
ā€œrequest.headers.Authorizationā€,
ā€œresponse.body.accessTokenā€
]
}
}

Remote Procedure: Name of Tags : communication tab
{
ā€œurlā€: ā€œmyapi.com/tagsā€,
ā€œmethodā€: ā€œGETā€,
ā€œheadersā€: {
ā€œAuthorizationā€: ā€œBearer {{connection.accessToken}}ā€,
ā€œAcceptā€: ā€œapplication/jsonā€
},
ā€œresponseā€: {
ā€œiterateā€: ā€œ{{body.data}}ā€,
ā€œoutputā€: {
ā€œnameā€: ā€œ{{item.name}}ā€
}
}
}

That 400 error usually means one module in the scenario failed earlier and everything downstream just collapsed after that. I’ve hit it when a mapping changed or a field suddenly came back empty. Checking the first failed request in the run history helped me spot it. Re-running only works after fixing the root step, not the one showing the error.

1 Like

Seems like your token is not valid or your request is incorrect, either way it is a client error.

It helps to use the Make DevTools to see what requests are sent by a scenario:
Chrome Extension:
Make DevTool - Chrome Web Store
Tutorial:
Introduction to Make Chrome DevTool (formerly Integromat DevTool)

Otherwise, it helps to use a service like webhook.site to temporarily catch the request coming from Make to either the auth endpoint or the endpoint you use in the RPC in order to check if the body and headers are what they should be.

Cheers,
Henk