T
Twenty7mo ago
wayne

Very slow response when payload incorrect

export async function main(twenty_api_key: string, data: Array) {
const url = 'https://api.twenty.com/rest/batch/people';
const options = {
method: 'POST',
headers: {
'Accept': 'application/json',
'Authorization': `Bearer ${twenty_api_key}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(data[0])
};
const response = await fetch(url, options);
return await response.text()
}
export async function main(twenty_api_key: string, data: Array) {
const url = 'https://api.twenty.com/rest/batch/people';
const options = {
method: 'POST',
headers: {
'Accept': 'application/json',
'Authorization': `Bearer ${twenty_api_key}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(data[0])
};
const response = await fetch(url, options);
return await response.text()
}
data =
[
{
"email": "[email protected]",
"jobTitle": "Angel Investor",
"lastName": "Koz",
"firstName": "Muenif",
"linkedinLink": {
"url": "http://www.linkedin.com/in/munifkoz",
"label": "LinkedIn"
}
}
]
data =
[
{
"email": "[email protected]",
"jobTitle": "Angel Investor",
"lastName": "Koz",
"firstName": "Muenif",
"linkedinLink": {
"url": "http://www.linkedin.com/in/munifkoz",
"label": "LinkedIn"
}
}
]
As you can see, firstname and lastname are put incorrectly. I get a 520 but it takes minutes to get back an answer
3 Replies
charles
charles7mo ago
That's very interesting, I can't see a reason why it should happen Could you create an issue in Github?
wayne
wayneOP7mo ago
Done
charles
charles7mo ago
thank you! closing this one as it's mapped on Github
Want results from more Discord servers?
Add your server