{ errors: [ { code: 'NAME_REQUIRED', message: 'Name is required' } ] }
Suddenly getting this error using the create org api
I am sending a name in my body
{"name":"IF","is_allow_registrations":true}
const createOrgRes = await fetch(orgUrl, {
method: 'POST',
headers: kindeheaders,
body: JSON.stringify({ "name": customer.customer_name, "is_allow_registrations": true })
});
console.log(JSON.stringify({ "name": customer.customer_name, "is_allow_registrations": true }));
const createOrgData = await createOrgRes.json();
console.log(createOrgData);
it worked few days ago, is anything changed?
11 Replies
Hi, Let me check into this for you.
I am not seeing any changes, can you confirm the payload you're sending?
{
method: 'POST',
headers: {
Accept: 'application/json',
Authorization: 'Bearer REMOVED'
},
body: '{"name":"Braedstrup IF","is_allow_registrations":true}'
}
{ status: 'error', error_id: '880e52162b64472985d37a218239bab5' }
i am listing org prior in my code withot problems, so my auth code is working
Thansk for giving the payload, I will look into the error and come back to you
Or
{
method: 'POST',
headers: {
Accept: 'application/json',
Authorization: 'Bearer REMOVED!!'
},
body: '{"name":"Braedstrup IF","is_allow_registrations":true}'
}
Failed to fetch org code from Umami: Bad Request
{ errors: [ { code: 'NAME_REQUIRED', message: 'Name is required' } ] }
I'm wondering if this is related to my issue I was having with importing organizations where it was telling me that the "name" column is required.
@Daniel_Kinde, any update?
Hi @ryno1234. I have been trying to find a way to reproduce your issue when supplying a name, I have been unable to. The only way I was able to get this issue is when name was empty.
I am going to DM you a link, book a slot on my diary and we can jump on a call and look into it together?
Any news on this one, just tried again and still receive the Name required..
{
method: 'POST',
headers: {
Accept: 'application/json',
Authorization: 'Bearer REMOVED!'
},
body: '{"name":"SabroIF","is_allow_registrations":true}'
}
{ errors: [ { code: 'NAME_REQUIRED', message: 'Name is required' } ] }
@C I have tried to reproduce this and not been able to, using your exact payload it works for me so keen to look at this with you closer. Can you give me reproduction steps or are you happy to jump on a call so I can look at the issue with you?
@Daniel_Kinde did you have the time to check the info i sent to you on DM?
I am sorry I missed your DM, I will check to see what could be happening here.
Hi @C
I have found the issue, when you're making the request the you need to include
'Content-Type':'application/json',
I added to your code and it worked ok.
Let me know if this works for you.nice find, do you know why it suddenly stopped working?
and thanks