I am setting up a new integration and I am successfully getting response data from the authentication. However, when attempting to make a test request to a valid endpoint I am receiving the error
TEST ValueError dictionary update sequence element #0 has length 5; 2 is required
What is this referring to?
Here is the authentication code:
const options = {
url: 'https://myfakeurl.com:8885/abc/api/authentication/GenerateAccessToken',
method: 'POST',
headers: {
'Content-type': 'application/json',
'Accept': 'application/problem+json'
},
params: {
},
body: {
'UserName': bundle.authData.UserName,
'Password': bundle.authData.Password,
'Domain': bundle.authData.Domain,
'AppName': bundle.authData.AppName,
'AppVersion': bundle.authData.AppVersion,
}
}
return z.request(options)
.then((response) => {
response.throwForStatus();
const result = response;
return [result];
});
Here is the code for using the response from the above (to test the authentication):
const options = {
url: `https://myfakeurl.com:8885/ABC/API/v1/{{bundle.authData.Domain/OData/Branches`,
method: 'GET',
headers: {
'Authorization': `Bearer ${result.Api.AccessToken}`,
'Content-type': 'application/json',
'Accept': 'application/json'
},
params: {
}
}
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;
});
TIA