-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
415 on get invitation-link #74
Comments
It's a bit of a late answer but if it can help other people, it's fine I guess. node-trustpilot uses Request (which is deprecated btw) so if you want to use queryStrings or change the Content-Type header, you can use the qs and headers properties, like this: await client.post(
'/v1/private/business-units/${process.env.TRUSTPILOT_BUSINESS_ID}/invitation-links',
{
qs: {
name: user.name,
locale: 'fr-FR',
redirectUri: 'https://stootie.com',
email: user.email
},
headers: {
'Content-Type': 'application/json'
}
}
); More informations on those options in Request's core repository |
Somehow await client.post(
`/v1/private/business-units/${process.env.BUSINESS_UNIT_ID}/invitation-links`,
{
body: {
name: user.name,
locale: "en-US",
redirectUri: `${process.env.REDIRECT_URI}`,
email: user.email,
},
headers: {
"Content-Type": "application/json",
},
}
); |
Hello,
i receive a 415 when i try to generate an invitation-link with your module.
i have an access token, my businessID, everything work fine to get all review :
await client("/v1/private/business-units/${process.env.TRUSTPILOT_BUSINESS_ID}/reviews")
but when i try to generate an invitation-link, i have a 415, it's a problem of media type. Maybe the content type : apllication/json is not set. But i don't know how to set it with your module.
This is my request :
await client.post("/v1/private/business-units/${process.env.TRUSTPILOT_BUSINESS_ID}/invitation-links", { name: user.name, locale: "fr-FR", redirectUri: "https://stootie.com", email: user.email, });
everything work fine on POSTMAN.
The text was updated successfully, but these errors were encountered: