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

Developers

403 on 'mutation createSpace'

Comments

13 comments

  • Avatar
    Miguel Estrada

    Thanks for the feedback.  Will get that corrected.

     

  • Avatar
    LUIS FELIPE FLOREZ LEANO

    Hello, and do you know how to make it work to add apps into an space? not just users?

     

    Thank you.

  • Avatar
    sveta goldstein (Edited )

    You should be able to use "updateSpaceAddMembers" mutation with id of the app you want to add to a workspace, ie

    mutation updateSpaceAddMembers { updateSpace(input: { 
    id: "space-id",
    title: "Space title",
    members: ["app-id"], memberOperation: ADD}){ memberIdsChanged } } } }

    Let me know if it doesn't work, happy to help. I had quite tough times developing an app for WWS.

  • Avatar
    LUIS FELIPE FLOREZ LEANO

    Hello Sveta, no, it does not work, it works for users but not with App IDs. It seems like a bug.

    Thanks.

  • Avatar
    sveta goldstein

    Do you try with graphql tool? Or via API requests?

  • Avatar
    LUIS FELIPE FLOREZ LEANO

    Both, Graphql tools works, API request with accessToken from Oauth does not work.

  • Avatar
    sveta goldstein (Edited )

    Seems like you're requesting API from app's identity? To perform this mutation you have to be authorized as a user, not an app.

    First you need an authorization code and then you request user access token. With this token you call graphQL API on behalf of a user.

    Notice, when you're obtaining the authorization code your scope should be 'read+write+ibmid'. I don't remember how I diged it out, as IBM WWS documentation still doesn't say anything about it. (Not an IBM employee here)

    https://workspace.ibm.com/oauth/authorize?response_type=code&client_id=<app-id>&redirect_uri=<redirect-uri>&scope=read+write+ibmid&state=123
  • Avatar
    LUIS FELIPE FLOREZ LEANO

    Hello Sveta, I am doing the complete OAuth dance to call the API on behalf of the logged in user and the accessToken works perfect to create the Space and to add users to that space, but does not work to add apps into de the space. I am geeting the following message after calling graphql:
    {"data":{"updateSpace":null},"errors":[{"message":"500 Internal Server Error","field":{"name":"updateSpace","type":"SpaceMutation"}}]}

    Thanks for your help.

  • Avatar
    Miguel Estrada

    Hello Luis,

    This is the 3rd thread where you are asking the same question.  Apologies for not having provided a faster answer...  Pasting the same answer from the other two entries you created:

    The ability to add an app to a space by an app that is authorized by a user is a separate issue which is known and being addressed. Targeting over the next couple of weeks at the moment.

  • Avatar
    LUIS FELIPE FLOREZ LEANO

    Hello Miguel.

     

    Thank you very much for the info, is there any way to track when the issue is solved?

     

    Thanks.

  • Avatar
    Miguel Estrada

    There is no automatic way to track state, but the issue is being tracked via issue # 28182.  It is being actively worked on.

  • Avatar
    LUIS FELIPE FLOREZ LEANO

    Hello team.

    Do we have any updates for the issue @28182? are we able to create an space and then add ussers and apps using the APIs with OAuth (As user)?

     

    Thank you very much.

  • Avatar
    Miguel Estrada (Edited )

     

    Hello Luis.

    28182 was indeed fixed.  In almost all cases you can just issue the API and it should work as expected.

    Depending on when your app was created there may be a need to update it.  If it was created after  2017, Sep, 23, 10am it should work without any changes.  If it was created prior to that time you can either create a new one (some times not convenient though if it is already in use) or DM me for further steps.

     

Please sign in to leave a comment.