Manage Assignments
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 /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 App
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:
-
Ensure you have the
versionId
of the version you want to unassign. -
Retrieve a list of the version's current organization assignments:
GET /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"
}
]
} -
Find the
id
of the organization that the version should be unassigned from. -
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 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 without options
- npm
- yarn
npx experience-app-cli apps assign
yarn experience-app-cli apps assign
If you run the command without any additional options, a prompt will appear to select the app and version.
- Choose the desired app from the provided list.
? Select an app (Use arrow keys)
❯ com.showpad.app.testapp.001
com.showpad.app.testapp.002
com.showpad.app.testapp.002
- Select the version of the app to be assigned.
? Select an app com.showpad.app.testapp.001
? Select an version (Use arrow keys)
❯ 1.0.0
1.0.1
- The command will prompt for the organization IDs, which should be entered as a comma-separated list.
? Select an app com.showpad.app.testapp.001
? Select an version 1.0.0
? Enter a comma separated list of the organisation IDs to assign the version to
Assigning with options
- npm
- yarn
npx experience-app-cli apps assign --organisations e462e148-0b5e-11ee-be56-0242ac120002 f5053d37-0b7e-11ee-be56-0242ac120002 --version-id 01H28FJ5MM5TQQF942P56RHFZ9
yarn experience-app-cli apps assign --organisations e462e148-0b5e-11ee-be56-0242ac120002 f5053d37-0b7e-11ee-be56-0242ac120002 --version-id 01H28FJ5MM5TQQF942P56RHFZ9
You can specify organizations and an app version using the --organisations
and
--version-id
options:
- Enter the organization IDs as a list with the
--organisations
option. - Enter the version ID with the
--version-id
option.