400 error
Hi Thoughtspot team!
I am new to ThoughtSpot, and I am trying to use the Create User API Endpoint in V2.
I wen to the REST v2 playground, to Create User, and without making any changes to the body, tried it out.
This is the response I got
{"error":{"message":{"debug":"invalid json response body at https://localhost/callosum/v1/v2/users reason: Unexpected end of JSON input"}}}
Link to page - https://developers.thoughtspot.com/docs/restV2-playground?apiResourceId=http%2Fapi-endpoints%2Fusers%2Fcreate-user
Additionally, I have tried to make the call to my server, but I get a 400 Error.
I am an admin, and I am able to get an access token.
Any help would be greatly appreciated!
REST API v2.0 Playground
ThoughtSpot REST API v2.0 Playground
4 Replies
Can you provide the input and the whole request you are trying to send? Looks like there might be something wrong with the request syntax.
So I just opened the Thoughtspot restv2 playground for create users
Link to page - https://developers.thoughtspot.com/docs/restV2-playground?apiResourceId=http%2Fapi-endpoints%2Fusers%2Fcreate-user
I did not make any changes to the request body at all, I just hit the "TRY IT OUT" button.
This is the Request input
curl -X POST \
--url 'https://try-everywhere.thoughtspot.cloud/api/rest/2.0/users/create' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer ZGVtb19kZXZ1c2VyOkpITm9hWEp2TVNSVFNFRXRNalUySkRVd01EQXdNQ1F4ZFVWdVduQlJNRXRSYkRsb01HWkthMk4zZVRkM1BUMGtaelJDZVRkVllrTndhbFZVVjNoNGExSk9UelF2YXpoTFdrbGxUMjVhVjAxdGRsVmpNMWRrSzFwTFNUMA==' \
--data-raw '{
"name": "name6",
"display_name": "display_name6",
"email": "email0",
"account_type": "LOCAL_USER",
"account_status": "ACTIVE",
"visibility": "SHARABLE",
"notify_on_share": true,
"show_onboarding_experience": true,
"onboarding_experience_completed": false
}'
^ all of this was directly copy pasted from the thoughtspot playground, I didn't change or write any of it.
You wouldn't have user create permission on the above trial instance.
The error does not give that information, which is a bug on our side and we are fixing it.
---
As @shikharTS said, We should look into why you are getting 400 on your own server where you have admin.
Thanks Ashish!
Actually, on my own server, I am no longer getting the 400 error (even though I didn't change the code lol). My code is working now!