Hi, I tested an API query in my browser and got a reasonable response (i.e. a lengthy json object that provides plenty of information).
I tried running the same query in my Python code and received a completely different response. While I got a Response [200], the json object was completely different in structure and therefore content.
The query I used: https://baselink.com/rest/api/space?spaceKey=spaceKeyName
Browser result: lengthy json file that had the same structure as shown in API documentation examples.
Python (command line) result: a VERY short json object that had different keys altogether, with the only information of some value being the query used. One specific value in this stunted response was under jsonObj[links][self], and the value of that was the same exact query I used in the browser (https://baselink.com/rest/api/space?spaceKey=spaceKeyName). Why does this happen?
And if it makes a difference, I am using the requests and json libraries in Python.
Hi Emily,
Just wanted to confirm that you passed in the same authentication via the command line as you did via the Web UI? If not, you may just be getting the public spaces in Python.
If you run https://baselink.com/rest/api/space?spaceKey=spaceKeyName in a clean browser session, does the response match your Python response?
CCM
Yes, it's the same authentication. I call it within a Python script, but run the script from the command line.
I am starting to get more matching results be replacing 'spaceKey' with 'key' (the documentation says the parameter is spaceKey, but JSON results show key).
That said, I still can't retrieve the correct JSON object for a space whose key I know of and have specified in the call. I end up retrieving all spaces instead.
Thanks,
Emily
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.