ZenHub GraphQL API's authorization issues

Hi there! My organization has tasked me with generating reports about issues left out in previous sprints, as a way of evaluating our use of ZenHub. I’ve been looking at the ZenHub API to create custom query to get, for each sprint, the number of open issues for each assignees. My problem is, I’ve run into a wall at the moment, and authorization seems to be the issue. Here is a list of the problems I encounter:

  1. ZenHub’s explorer feature returns an error when fetching the schema (the option “Show Documentation Explorer” return a red rectangle that say “Error fetching schema”),
  2. ZenHub’s explorer feature returns the same errors everytime I try to enter a query. It is always the same error:
{
    "errors": [
        {
             "message": "JSON.parse: unexpected character at line 1 column 1 of the JSON data",
             "stack": ""
        }
    ]
}
  1. I thought maybe the explorer feature might be experiencing troubles, so I tried a simple HTTP POST query using fetch() in JavaScript (Node.js). It returns a success, but the data I get back displays an error.
    Query result using JS

Do you have any idea as to why nothing seems to work? At this point I’m wondering if I even have sufficient authorization on my workspace/in my organization to access its schema. Do note that I’ve generated API key multiple times, and tried with several different ones. A developper colleague of mine also tried to do the same thing, and got similar errors (at least in the explorer feature).

Thanks for your input and your help!
Joël

Here is the simple code I’m using in JS, which contains the query I copied from the exemples in the API’s documentation:

Hi @ante_jr,

Sorry to hear that you’re experiencing issues using our API. The explorer definitely appears to be working from my side here. Can I just confirm that the API token that you’re using is generated from the graphql API page here.

Thank you,
Will

Hi @WillDonohoe,

Thank you very much for your response. I can confirm that my tokens are generated using the graphql API page, as this screenshot will attest:

All best,
Joël

Okay all seems to be correct. Would you mind trying the explorer again to see if it’s working for you now? We’re not seeing any issues on our side. If there are still issues, could you contact support@zenhub.com with reference to this thread and the email address you signed up to Zenhub with and we can check your account any permission related issues.

Thanks!

Yeah, I think I’ll contact your support team, thank you for your time. Posting this screenshot of the explorer to examplify the issue: