curl -i -d '{"spaceId":"LM30TehYj1NIDFh3EOUit", "name":"hello world"}' -H "Content-Type: application/json" -H "Authorization: <scrubbed>" -X POST http://api.kinopio.club/card
I’m getting a 500. I am getting the same result using a few other libraries, but I figure curl
is the most common. For example, using httpie. I know this worked before, so I’m pretty sure the syntax is right. And regardless, it’s a server-side error…
http POST https://api.kinopio.club/card "Authorization: $KINOPIO_API_KEY" spaceId=$KINOPIO_SPACE_ID name="$*"
1 Like
When I try the api request in paw it creates the card. I can confirm that all you need in the request body
is spaceId
and name
- is this the same authorization method you use for other api calls?
- did this used to work but doesn’t now?
hmm, yes, this is the same authorization method I’ve used in the past. this used to work, I know especially the httpie call I made because I wrote a script that uses it. do the server logs indicate why this is failing?
can you make the call right now and let me know when you do, if you’re around? otherwise it’s hard to find without some specific unique id/string to search the logs for
hmm not the greatest err msg:
2021-04-27T03:15:21.944154+00:00 app[web.1]: {"level":30,"time":1619493321943,"pid":76,"hostname":"cecf2f66-01e3-4fc7-9cd1-676880562fe2","err":{"type":"Error","message":"failed with status code 500","stack":"Error: failed with status code 500\n at ServerResponse.onResFinished (/app/node_modules/pino-http/logger.js:52:33)\n at ServerResponse.emit (events.js:326:22)\n at ServerResponse.EventEmitter.emit (domain.js:483:12)\n at onFinish (_http_outgoing.js:735:10)\n at onCorkedFinish (_stream_writable.js:673:5)\n at afterWrite (_stream_writable.js:490:5)\n at afterWriteTick (_stream_writable.js:477:10)\n at processTicksAndRejections (internal/process/task_queues.js:83:21)"},"responseTime":1458,"msg":"request errored","v":1}
“error is error”
1 Like
are you able to make a curl call that works? and I could try on my end?
hmm can you try a basic GET /
and see if that works?
and a GET /space/[spaceid]
to check the auth
1 Like
yep, that works, I did a GET
on that private space with that authorization header, and I got a 200 (and the info)
Yup I’ll try that in a bit
1 Like
I don’t really use curl and I couldn’t get it working (for syntax reasons),
when I exported the paw request to curl I got
curl -X "POST" "https://api.kinopio.club/card" \
-H 'Authorization: AUTH_API_KEY' \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{"spaceId": "n8HfwGead6o3sC71X98Vx", "name": "🎡🎡🎡🎡"}'
is this helpful?
lol, yeah this is me too. I just mentioned/used it because it’s kinda the lowest common denominator. yes, this looks good, let me try with some id’s changed…
got it working with this
curl -X "POST" "https://api.kinopio.club/card" \
-H 'Authorization: AUTH_API_KEY' \
-H 'Content-Type: application/json; charset=utf-8' \
-d '{"spaceId": "n8HfwGead6o3sC71X98Vx", "name": "🎡🎡🎡🎡"}'
response I got from curl was
{"isRemoved":false,"commentIsVisible":false,"spaceId":"n8HfwGead6o3sC71X98Vx","name":"🎡🎡🎡🎡","id":"QPGfwEyreWVGjlOZSzV_Y","x":387,"y":167,"z":1166,"updatedAt":"2021-04-27T03:25:59.273Z","createdAt":"2021-04-27T03:25:59.273Z","frameId":null,"userId":null,"nameUpdatedAt":null,"nameUpdatedByUserId":null,"linkToSpaceId":null}
I tried this with my api key and a spaceId that I own, but still a 500
HTTP/1.1 500 Internal Server Error
Server: Cowboy
Connection: keep-alive
X-Powered-By: Express
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
X-Ratelimit-Limit: 8
X-Ratelimit-Remaining: 7
Date: Tue, 27 Apr 2021 03:27:58 GMT
X-Ratelimit-Reset: 1619494079
Content-Type: application/json; charset=utf-8
Content-Length: 2
Etag: W/"2-vyGp6PvFo4RvsFtPoIWeCReyIC8"
Vary: Accept-Encoding
Via: 1.1 vegur
{}%
puzzled
btw, I threw in a curl -i
to get curl to print the response header. maybe I’ll try a different space?
update: okay, an open one worked.
yeah, I double-checked my API key. it’s correct—it worked with the GET request. and I would expect, if the key were not right, to get a 401, not a 500. let me try a new space I create…
ya try an open space to rule out auth,
keep in mind that the authApiKey is not the same as the userId
feel free to dm me your complete curl (w api key) and i’ll try and verify it tmrw morning
Also I ran the curl command from fish shell, but that probably doesn’t matter?
okay, a different private space is working. so maybe something whack with the other one ¯\_(ツ)_/¯
1 Like
hmm ya usually if it’s a spaceid that doesn’t exist you’ll get a 404
okay, in the first space I tried where all this wasn’t working…it had no cards there. so I created a card manually, tried it again, and the POST worked. so maybe it’s some bug where I can’t add to a space with no cards.
2 Likes