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

Developers

add apps to spaces with the GraphQL API reference

Comments

8 comments

  • Avatar
    Darren Cacy

    It's not currently possible for one app to add another app. You are not the first person to ask this question. :-(

  • Avatar
    Benedikt Krüger

    Oh Wow. Is it somehow planned to add this feature? Is there a known workaround for this issue? Can I send messages from and to a Webhook without adding an application?

  • Avatar
    Darren Cacy

    I don't know if there are any plans to allow apps to add apps. You may want to submit an idea: https://help.workspace.ibm.com/hc/en-us/community/topics/201154408-Ideas

    You must have an app added to the space in order to send messages to/from a webhook. 

    One item in the works is the notion of "templates", which allow you to identify apps and users to populate a space when it is created. More information is coming soon, and perhaps this will address your situation.

  • Avatar
    VAN STAUB

    Yes there is a known issue; I reported it to Miguel about two weeks ago.  No, the app must be a member in a space to receive messages - either via webhook (push) or requesting the space's messages (pull). 

    The behavior should be functionally the same as adding members.  If you know the appId, then updating the space membership with it should be sufficient.  It does not work if you run the GraphQL as an app or on behalf of a user (i.e. OAuth token).  It does however work if you know the JWT token - say by pulling it from the browser session.  But that's not a workable solution as the JWT expires too quickly and is manual to pull from browser headers.

    I see a need to have it both ways - allowing an app to add other apps on behalf of the user but also because said app either has dependencies or is part of a "collection".  There are security concerns I'm sure with the latter.

    And as Darren said, templates would give us a way to accomplish this - assuming our use case is all about adding apps upon space creation.

  • Avatar
    Miguel Estrada

    Yes.  It is a known issue that a user working via a "client" app other than workspace (or an app acting on behalf of a user which is essentially saying the same thing) can't add an app to a space.

     

  • Avatar
    Miguel Estrada

    Issue # as a reference: planning/issues/28182

     

  • Avatar
    Miguel Estrada

    This is being actively worked on this week.

  • Avatar
    Miguel Estrada

    Update: all client apps created after September 23 10:00:00 (UTC) should be working now if they try to add an app to a space via the updateSpace or addSpaceMembers mutations.  Note that as before, this is applicable only to apps acting as clients for users who log in / authorize them via oauth

    If you have an app created prior to the above date which requires this functionality you can either

    A - create new app declaration with same webhooks, etc...  this may not be an option for all though if the app is deployed in many spaces (without some other app that ironically.... would add the new app and delete the old app...)

    B - let us know and we can reset permissions on your existing app

    C - await upcoming functionality for you to specify permissions for your app

Please sign in to leave a comment.