I’m trying to create an integration so that our external partner can add users to the system from a form without having access to our backend.
I have created a couple actions using the Zapier platform which all work fine for creating new objects, except I’m having an issue with one of our API requests.
const options = {
url: 'https://hidden.url',
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': '*/*',
'AUTHORIZATION': bundle.authData.Authorization,
'Connection': 'keep-alive',
'Accept-Encoding': 'gzip, deflate, br'
},
params: {
'Authorization ': bundle.authData.Authorization
},
body: {
'firstname': bundle.inputData.firstname,
'surname': bundle.inputData.surname,
'email': bundle.inputData.email,
'account': bundle.inputData.account,
'plainPasswordsfirst]': bundle.inputData.plainPassword,
'plainPasswordssecond]': bundle.inputData.plainPassword
}
}
return z.request(options)
.then((response) => {
response.throwForStatus();
const results = response.json;
// You can do any parsing you need for results here before returning them
return results;
});
You can see in this code snippet for the API configuration in the body I have plainPasswordafirst] and plainPasswordasecond], both of these body items need to match so I uses the same input plainPassword.
However on testing the request it is consistently reporting back with failed due to 401 error “JWT token expired”, even though I know that the same authorization details are working fine for all other requests.
It would be great to get some suggestions on next steps I can take on trying to solve this issue.