Endpoints / Auth Token / parameters
-
Re: Auth Tokens
Hi guys, trying to play with api endpoints, but do not understand this: curl -H "X-Auth-Token:
" https://screeps.com/api/user/code?_token=AA-BB-CC-DD-EE ** works fine ** curl -H "X-Auth-Token:
" https://screeps.com/api/user/memory?_token=AA-BB-CC-DD-EE&shard=shard3 results in {"error":"invalid shard"} some other endpoints do work (money-history), most others do not. Any hint what I am doing wrong ? Is there a valid documentation of the endpoint parameters ?
-
Haven't played with the web api much, would recommend if you don't get an answer here in a bit trying out the Slack.
-
@donatzor thanks ! actually, I am trying hard since quite a while, and I assume that the api somehow went dysfunctional. All libraries and tools and most of the posts are some 3 years old. I think, I did read most of the infos google can find, and I have to go back to the game source to find more info. But I am even not sure that github.com/screeps holds the current source version, did not find the api source there up to now. It's a pity, since I really started to like this game, but it seems to got stuck some yrs ago.
-
There is some differences between the official server and the private server.
This mod is basicly default on most servers and bridges the gap between official servers and private servers https://github.com/ScreepsMods/screepsmod-admin-utils
node-screeps-api is fairly up to date. as an example here are the memory endpoints
https://github.com/screepers/node-screeps-api/blob/01712e09ebff7dfc3e51c333142d5da7ad63918a/src/RawAPI.js#L723-L764else I would suggest dropping by on slack https://chat.screeps.com/ lots of people there able to help
-
The command
curl "https://screeps.com/api/user/memory?_token=***&shard=shard3"
works perfectly fine for me. The issue is likely that you don't have quotes around the URL. This would cause the & to break it into two separate commands.
-
@segmentationfaultcoredumped Hey man ! you see me deeply ashamed ... after some 2 decades of unix ... a problem like that ! Thanks a lot, I owe u a beer