Managing organizations
A catalog can contain exactly one main organization (also called parent or root organization) and may contain sub-organizations.
Go to Organizations in Partium for further information about the use of organizations in the Partium system.
Use the following endpoints to manage organizations in a catalog:
Creating or updating organizations
POST /1/catalog/organizations
Multiple organizations can be created and/or updated in one call by specifying a list of organizations.
The endpoint returns a list of ids of organizations, which have been created
and a list of updated
ids.
The result contains also an error
dictionary in case some organizations could not be created with corresponding error descriptions.
Parameter | Value |
---|---|
org_id | Unique id of the organization in the catalog |
parent_id | Id of the parent organization, is empty for main organization |
display_name | This name is displayed in the app |
default_language | Preselected language of the organization in the app |
ordered_fallback_ui_languages | Ordered list of language codes to select translations in the UI |
This endpoint will respond with error code 503 when the catalog API is in maintenance mode.
🡢 See Find API Documentation to learn more about Fallback Languages 🡢 See API Reference
- HTTP
- Python
- JavaScript
> POST https://api.partium.io/1/catalog/organizations
> Authorization: Bearer <<Your Access Token or API Key>>
> Content-Type: application/json
>
>[
> {
> "org_id": "my-main-org",
> "parent_id": "",
> "display_name": "organization name",
> "default_language": "en",
> "ordered_ui_fallback_languages": ["en", "de"]
> }
>]
>
< HTTP/1.1 200 OK
< Content-Type: application/json
<
<{
< "created": ["my-main-org"],
< "updated": [],
< "errors": {}
<}
response = requests.post(
'https://api.partium.io/1/catalog/organizations',
headers={
'Authorization': 'Bearer <<Your Access Token or API Key>>',
},
json=[
{
"org_id": "my-main-org",
"parent_id": "",
"display_name": "organization name",
"default_language": "en",
"ordered_ui_fallback_languages": ["en", "de"]
}
]
)
fetch('https://api.partium.io/1/catalog/organizations', {
method: 'POST',
headers: {
Authorization: 'Bearer <<Your Access Token or API Key>>',
},
body: [
{
"org_id": "my-main-org",
"parent_id": "",
"display_name": "organization name",
"default_language": "en",
"ordered_ui_fallback_languages": ["en", "de"]
}
]
}).then(res => {
...
});
Replace <<Your Access Token or API Key>>
with the preferred authentication method. See Authentication.
Deleting organizations
DELETE /1/catalog/organizations
Multiple organizations can be deleted in one call by specifying a list of organization ids.
The endpoint returns a list of ids of organizations, which have been deleted
.
The result contains also an error
dictionary in case some organizations could not be deleted with corresponding error descriptions.
This endpoint will respond with error code 503 when the catalog API is in maintenance mode.
🡢 See API Reference
- HTTP
- Python
- JavaScript
> DELETE https://api.partium.io/1/catalog/organizations
> Authorization: Bearer <<Your Access Token or API Key>>
> Content-Type: application/json
>
>["my-org-id"]
>
< HTTP/1.1 200 OK
< Content-Type: application/json
<
<{
< "deleted": ["my-org-id"],
< "errors": {}
<}
response = requests.delete(
'https://api.partium.io/1/catalog/organizations',
headers={
'Authorization': 'Bearer <<Your Access Token or API Key>>',
},
json=["my-org-id"]
)
fetch('https://api.partium.io/1/catalog/organizations', {
method: 'DELETE',
headers: {
Authorization: 'Bearer <<Your Access Token or API Key>>',
},
body: ["my-org-id"]
}).then(res => {
...
});
Replace <<Your Access Token or API Key>>
with the preferred authentication method. See Authentication.
Listing organizations
POST /1/catalog/organizations/list
Query a list of organizations.
The list can be filtered by specifying an organization type
.
A paging mechanism can be used to fetch more data if the number of results exceeds the paging limit
.
Parameter | Value |
---|---|
query.type | Optional type of the organizations to fetch, can be all , root , or sub |
paging.limit | Maximum number of results returned by the endpoint |
paging.last_object_id | Use this id to get the next page of results. The id is returned by a previous call to this endpoint |
projection | Optional list of fields to be included in the response. Possible values: parent_id , display_name , default_language |
🡢 See API Reference
- HTTP
- Python
- JavaScript
> POST https://api.partium.io/1/catalog/organizations/list
> Authorization: Bearer <<Your Access Token or API Key>>
> Content-Type: application/json
>
>{
> "query": {
> "type": "all"
> },
> "paging": {
> "limit": 10
> },
> "projection": ["display_name"]
>}
>
< HTTP/1.1 200 OK
< Content-Type: application/json
<
<{
< "result": [
< {
< "org_id": "my-org-id",
< "display_name": "organization name",
< }
< ],
< "last_object_id": "unique_object_id",
< "more_data": false
<}
response = requests.post(
'https://api.partium.io/1/catalog/organizations/list',
headers={
'Authorization': 'Bearer <<Your Access Token or API Key>>',
},
json={
"query": {
"type": "all"
},
"paging": {
"limit": 10
},
"projection": ["display_name"]
}
)
fetch('https://api.partium.io/1/catalog/organizations/list', {
method: 'POST',
headers: {
Authorization: 'Bearer <<Your Access Token or API Key>>',
},
body: {
"query": {
"type": "all"
},
"paging": {
"limit": 10
},
"projection": ["display_name"]
}
}).then(res => {
...
});
Replace <<Your Access Token or API Key>>
with the preferred authentication method. See Authentication.
more_data
in the response is true
indicates that there are more results to fetch.
In that case use the returned last_object_id
as a parameter for the next call to fetch the next page of results. Repeat this until more_data
is false
.
Fetching organizations by ID
POST /1/catalog/organizations/select
Fetch a list of organizations by specifying a list of organization ids.
Parameter | Value |
---|---|
org_ids | List of ids of organizations to fetch |
projection | Optional list of fields to be included in the response. |
🡢 See API Reference
- HTTP
- Python
- JavaScript
> POST https://api.partium.io/1/catalog/organizations/select
> Authorization: Bearer <<Your Access Token or API Key>>
> Content-Type: application/json
>
>{
> "org_ids": ["my-org-id"],
> "projection": ["display_name"]
>}
>
< HTTP/1.1 200 OK
< Content-Type: application/json
<
<[
< {
< "org_id": "my-org-id",
< "display_name": "organization name",
< }
<]
response = requests.post(
'https://api.partium.io/1/catalog/organizations/select',
headers={
'Authorization': 'Bearer <<Your Access Token or API Key>>',
},
json={
"org_ids": ["my-org-id"],
"projection": ["display_name"]
}
)
fetch('https://api.partium.io/1/catalog/organizations/select', {
method: 'POST',
headers: {
Authorization: 'Bearer <<Your Access Token or API Key>>',
},
body: {
"org_ids": ["my-org-id"],
"projection": ["display_name"]
}
}).then(res => {
...
});
Replace <<Your Access Token or API Key>>
with the preferred authentication method. See Authentication.