Hi all,
New user here. I have a bit of a conundrum. So the context is I’m trying to work out if I can update 8000 users via a script I run through Postman to our provider’s API interface. I’ve stumbled at the first hurdle: The provider’s API gives me different fetch outputs than Postman.
So I thought I’d run some tests to see IF I can use Postman with the SmartRecruiter’s API. So I ran a very simple query - Get user details for a ‘Test User’ via the API interface:
As you can see, I get a returned result for ‘Test User’. All is good. I’ve redacted the auth token but it’s irrelevent to this query as it IS working in both the API interface AND Postman as I DO get user data returned from my instance.
This is the code the supplier’s interface provided:
const options = {
method: 'GET',
headers: {
accept: 'application/json',
'x-smarttoken': 'REDACTED FOR THIS POST'
}
};
fetch('https://api.smartrecruiters.com/user-api/v201804/users?q=Test%20User&limit=1', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
If I literally copy the Fetch request and paste it into Postman, with the same Auth key, same query etc, I get a return from the API Server (yay!), but I’m getting a list of all users in my system:
That’s not what I, or the code, asked for (I can’t post all the output because it has user identities on it but you can see the ‘limit’: 100 when the code clearly specified Limit:1), and I’m definitely not gettting ‘Test User’ returned. I am not sure what I need to tweak to make it work. Any thoughts?
The next step will be to use Update a user to send a test update via a PATCH command to my test user, but at the moment I can’t trust it’s not going to update ALL my users and I REALLY don’t want that to happen, so I am hoping to narrow down what I’m doing wrong in the GET stage first where I can’t break anything.
Your assistance is very much appreciated.


