Jump to content

REST Error - "NO_USERNAME_OR_EMAIL" despite both provided?


Roboko

Recommended Posts

Posted

Hello, I've been trying to use the REST api to create a new user on my test forum.

 

My request is like the following (I changed some details to protect my website):-

URL https://testforum.example.com/api/core/members?key=########################

###### Being API Key

Body

{"email":"example@example.com","group":3,"name":"username","password":"Spaghetti20!"}

Headers is just containing Content-type application/json

When I send a request in this format, I get back

{
"errorCode": "1C292\/8",
"errorMessage": "NO_USERNAME_OR_EMAIL"
}

As you can see from request body, I do send both username and email field as per the documentation

So why do I get this error..?

Also, another strange thing is that, whilst I get a response from my server, it is not logged. REST api logs shows up as empty, no failures..?

 

Any help would be greatly appreciated.

 

 

Posted

Fixed it myself, posting solution in case it helps others

Turns out that invision REST API does not accept json. You must encode with  application/x-www-form-urlencoded . Would have been nicer if the server gave an appropriate error response for this. it took me by surprise that JSON isn't accepted.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...