Skip to main content

Assign to Organizations

Prerequisites

To manage app assignments to other organizations, you must have:

  • the versionID of the app version to assign, and
  • the other organization's Partner Code.

Once an app is uploaded and successfully processed, it's automatically assigned to your developer organization.

Via API

Assign App

You can assign your app to another organization by creating the assignment. This can be done by calling:

POST https://{subdomain}.api.showpad.com/app-portal/v1/versions/{versionId}/assignments

{
"type": "SPECIFIC_ORGANISATIONS",
"organisations": [
{ "id": "{{organisationId}}" }
]
}

The response will contain all existing assignments and the assignment you've just created.

{
"type": "SPECIFIC_ORGANISATIONS",
"organisations": [{ "id": "XXX" }, { "id": "YYY" }]
}

All done! The organization's administrator will now be able to install the assigned version of your app and publish it.

Unassign an App

caution

When an app version is unassigned. It will stop working for the organization it was unassigned from. It can take several minutes before the unassigment is processed on all servers.

To unassign an app version from an organzation:

  1. Ensure you have the versionId of the version you want to unassign.

  2. Retrieve a list of the version's current organization assignments:

    GET https://{subdomain}.api.showpad.com/app-portal/v1/versions/{versionId}/assignments
    {
    "type": "SPECIFIC_ORGANISATIONS",
    "organisations": [
    {
    "id": "abc-123",
    "assignedBy": "xxx",
    "assignedAt": "2023-05-03T14:55:58.971Z"
    },
    {
    "id": "def-456",
    "assignedBy": "xxx",
    "assignedAt": "2023-05-03T14:55:17.022Z"
    }
    ]
    }
  3. Find the id of the organization that the version should be unassigned from.

  4. Using the id you just identified, you can delete the assignment to that specific organization:

    DELETE https://{subdomain}.api.showpad.com/app-portal/v1/versions/{versionId}/assignments/organisations/{organisationId}

    Upon successful deletion, you’ll receive a 204 No Content response with no body.

That's it! The unassigned version is no longer usable by the specified organization.

Via CLI

Assign an App

The apps assign command enables you to assign a specific version of your app to one or more Showpad organizations. To use this command, follow the instructions below:

Assigning with specifying partner-code

npx showpad apps assign --partner-code 718b2b4d-8eb3-4bc6-91b9-49c4cd28f8bc

If you run the command without any additional options, a prompt will appear to select the app and version.

  1. Choose the desired app from the provided list.
  Loading apps... done
? select the app to assign (Use arrow keys)
❯ com.showpad.app.testapp.001
com.showpad.app.testapp.002
com.showpad.app.testapp.002
  1. Select the version of the app to be assigned.
  Loading versions... done
? select the version to assign (Use arrow keys)
1.0.0
1.0.1

Assigning with options

npx showpad apps assign --partner-code 718b2b4d-8eb3-4bc6-91b9-49c4cd28f8bc --partner-code f5053d37-0b7e-11ee-be56-0242ac120002  --app-version-id 01H28FJ5MM5TQQF942P56RHFZ9

You can specify organizations and an app version id using the --partner-code and --app-version-id options:

  1. Enter the organization IDs as a list with the --partner-code option.
  2. Enter the version ID with the --app-version-id option.

Unassign an App

The apps unassign command enables you to unassign a previously assigned version of your app from Showpad organizations. To use this command, follow the instructions below:

    npx showpad apps unassign --partner-code 718b2b4d-8eb3-4bc6-91b9-49c4cd28f8bc

If you run the command without any additional options, a prompt will appear to select the app and version.

  1. Choose the desired app from the provided list.
  Loading apps... done
? select the app to unassign (Use arrow keys)
❯ com.showpad.app.testapp.001
com.showpad.app.testapp.002
com.showpad.app.testapp.002
  1. Select the version of the app to be unassigned.
  Loading versions... done
? select the version to unassign (Use arrow keys)
1.0.0
1.0.1

Unassigning with options

    npx showpad apps unassign --partner-code 718b2b4d-8eb3-4bc6-91b9-49c4cd28f8bc --partner-code f5053d37-0b7e-11ee-be56-0242ac120002  --app-version-id 01H28FJ5MM5TQQF942P56RHFZ9

You can specify organizations and an app version id using the --partner-code and --app-version-id options:

  1. Enter the organization IDs as a list with the --partner-code option.
  2. Enter the version ID with the --app-version-id option.