Watson Workspace will no longer be available after February 28, 2019. Learn more.

Developers

I'm getting emty spaces in my application but not in the graphql editor

Comments

6 comments

  • Avatar
    CARLOS MANIAS

    I just tried in Postman (a REST client) and it works fine for me...

     

    What headers are you using? I'm using 

    Content-Type: application/graphql

    jwt: <jwt token>

  • Avatar
    Job Cuppen

    I'm using the same headers but both in my restclient (Insomnia), fiddler and my java-application it still returns

    {"data":{"spaces":{"items":[]}}}

  • Avatar
    Miguel Estrada

    Is it the same jwt token for both?  Seems like one user has spaces and the other does not ?

  • Avatar
    Job Cuppen

    its my own application using credentials generated in my own account. so I'm sure I have spaces.

    Or is it empty because my application does not have spaces but I do?

  • Avatar
    Miguel Estrada

    That is what I am suspecting.   Creating an app gives you appid+secret.  You can convert those to a jwt which you seem to have already done.  That jwt is the identity of the app which is a different identity from you the creator of the app.

    For the app to "act like you" it needs to establish an oauth2 flow using the code grant (if you are familiar with oauth2 flows).  I am not sure if the Registration for Apps has been updated today to allow you to enter the redirect URL for that app which will be needed for oauth2 code grant flows.

    Regardless, see if you can add the app to a space (go into settings / apps) and then re-issue the query and perhaps it will yield a result of that space in which the app was added to.

  • Avatar
    Job Cuppen

    I found what was going wrong. I forgot to add my app to my Workspace. After adding it to the workspace it instantly found my space

Please sign in to leave a comment.