Hey all,
I am trying to build a connection to Front to interact with the conversations, so we can assign the assignees to the conversations through the API. Using the example of the API documentation keeps giving me errors and I can’t figure out what is going wrong. I’m using the Update conversation assignee with the NodeJS example, but I keep getting an error:
{"_error":{"status":400,"title":"Bad request","message":"Body did not satisfy requirements","details":i"body.assignee_id: missing"]}}
I’ve tried it with JSON and FormData, but the error stays the same, my latest example code is the following
const frontUpdateAssignee = async ({ conversation, assignee, token }) => {
const options = {
method: "PUT",
headers: {
accept: "multipart/form-data",
authorization: `Bearer ${token}`,
},
body: JSON.stringify({ assignee_id: "tea_hjdlj" }),
};
const updateAssignee = await fetch(
`https://api2.frontapp.com/conversations/${conversation}/assignee`,
options
)
.then((res) => res.json())
.then((res) => console.log(res))
.catch((err) => console.error(err));
return {
result: updateAssignee,
};
};
I can’t figure out what is going wrong after a few hours. Hope you guys can get me on track.