Server wants username as int but in reality it's a string

Hello, I have a limited contact with person who provided me with access to this API they’re using. Until I get into contact with them, I though I’d try in this community.

So, there are six parameters to pass to a server. Username, Password and some others. In the documentation online, Username is defined as an integer and all their examples use a five-digit number as Username. When I try to pass my parameters (which include a string Username), I get a response that the value is not valid for Username.

This person told me “You have to change int to string, that’s what we do when it comes to this version 2 of API”.

I tried this code from Postman answers that defines these values in pre-request, stringifies them, saves them to the environment and them calls it in body. I got the same unwanted response from the server.

Any ideas on how to tackle this? I’m thankful for any input.

This sounds like a server side issue with the API.

If the API documentation is telling that the username must be an integer, then you’ll need to send it a number unless the API is changed to accept a string.

I don’t think there is anything you can do client side in Postman that will make any difference here.

You can only send to the API, what the API is designed to accept.

Have you tried sending a dummy request with a 5 digit number? Does it work?

1 Like

Thank you for your time. I just tried with random 5-digit number and response is different than when I send a string. Now it says that username and password are not valid.
This is really weird because I trust this person wouldn’t give me wrong info on purpose and I can use the Username/password combo to log in into their demo environment where results of API requests can be seen.