maiki
(maiki)
April 2, 2022, 12:58am
1
Heya folks!
I was looking at https://meta.discourse.org/t/api-500-on-user-creation-if-username-is-integer/222281?u=maiki and can only kinda reproduce it, using curl
. I’m looking through the docs to see if there is a useful output to capture to assist in figuring out what is happening, and then remember httpie
as well…
And then I thought I’d just ping the @support-explorers and ask if they would share tools and recipes they use to debug the API!
What do you use to troubleshoot and interact with the API?
3 Likes
In general, I am a huge fan of Postman. it helps to emulate API calls and their responses.
3 Likes
rorycb
(Rory Craig-Barnes)
April 2, 2022, 10:56am
3
I generally use Insomnia or Postman for any API debugging (not just Discourse), I don’t really have any collections to share to speed that up for you though
3 Likes
maiki
(maiki)
April 2, 2022, 5:17pm
4
That’s great, that’s what I’m looking for.
I also use insomnia to get through some wicked problems…
Oh, you meant https://insomnia.rest/ !
(TIL: there is a .rest
TLD!)
1 Like
Seluj78
(Jules Lasne)
April 4, 2022, 7:54am
5
Hi @maiki , thanks for looking into this!
Here’s a CURL request you can use, which was generated from postman (if you’d like). This generates a 500:
curl --location --request POST 'https://XXX.com/users.json' \
--header 'Api-Key: XXX' \
--header 'Api-Username: XXX' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "XXX",
"email": "XXX@mail.com",
"password": "aTestPAssword",
"username": 1,
"active": true,
"approved": true
}'
2 Likes