CONTROL APIProjects Update Project Update project with specified id.
Update Project
PATCH
https://environment.monterosa.cloud/api/v2/projects/:project_id
Path Parameters
Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb
Request Body
presence_counter[min_threshold]
Minimal threshold. Can be greater or equal to 0. Default value can be set via App Spec.
presence_counter[enabled]
Switch on/off presence counter.
Presence counter on client application setup.
Available if it is enabled on App Spec level only.
Project's elements visibility settings.
Project's audio sync default delay.
Project's audio sync max delay.
Defines if Certification is enabled for a project.
Marks project as archtived.
Users with at least the Admin role can change this attribute.
Sets environment of the project. Allowed values: "staging"
(default), "production"
.
Users with at least the Admin role can change this attribute.
Example
Request Response cURL
Copy // PATCH /api/v2/projects/951a951e-07de-457f-99c8-f1307fad4eeb
// Host: environment.monterosa.cloud
// Authorization: Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb
// Content-Type: application/vnd.api+json
{
"data": {
"type": "projects",
"id": "951a951e-07de-457f-99c8-f1307fad4eeb",
"attributes": {
"name": "NEW Project Name"
}
}
}
Copy // Response: 204 No Content
Copy curl --request PATCH \
--url https://environment.monterosa.cloud/api/v2/projects/951a951e-07de-457f-99c8-f1307fad4eeb \
--header 'Authorization: Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb' \
--header 'Content-Type: application/vnd.api+json' \
--data '{
"data": {
"type": "projects",
"id": "951a951e-07de-457f-99c8-f1307fad4eeb",
"attributes": {
"name": "NEW Project Name"
}
}
}'
App Setup settings
List of fields of App Setup . Each field is updated separately and if present its content is rewritten completely.
Request Response cURL
Copy curl --request PATCH \
--url https://environment.monterosa.cloud/api/v2/projects/951a951e-07de-457f-99c8-f1307fad4eeb \
--header 'Authorization: Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb' \
--header 'Content-Type: application/vnd.api+json' \
--data '{
"data": {
"type": "projects",
"id": "951a951e-07de-457f-99c8-f1307fad4eeb",
"attributes": {
"settings": [
{
"key": "logo",
"values": {
"all": "https://monterosa.com/img/logo.png"
}
},
{
"key": "language_selector_position",
"values": {
"all": "left"
}
},
{
"key": "text",
"values": {
"en": "Lorem ipsum dolor"
}
},
{
"key": "number",
"values": {
"all": 42
}
}
]
}
}
}'
Copy // Response: 204 No Content
Copy curl --request PATCH \
--url https://environment.monterosa.cloud/api/v2/projects/951a951e-07de-457f-99c8-f1307fad4eeb \
--header 'Authorization: Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb' \
--header 'Content-Type: application/vnd.api+json' \
--data '{
"data": {
"type": "projects",
"id": "951a951e-07de-457f-99c8-f1307fad4eeb",
"attributes": {
"settings": [
{
"key": "logo",
"values": {
"all": "https://monterosa.com/img/logo.png"
}
},
{
"key": "language_selector_position",
"values": {
"all": "left"
}
},
{
"key": "text",
"values": {
"en": "Lorem ipsum dolor"
}
},
{
"key": "number",
"values": {
"all": 42
}
}
]
}
}
}'
Hidden elements
Elements visibility settings are updated by providing hidden_elements
attribute and only for provided element types.
Request Response cURL
Copy curl --request PATCH \
--url https://environment.monterosa.cloud/api/v2/projects/951a951e-07de-457f-99c8-f1307fad4eeb \
--header 'Authorization: Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb' \
--header 'Content-Type: application/vnd.api+json' \
--data '{
"data": {
"type": "projects",
"id": "951a951e-07de-457f-99c8-f1307fad4eeb",
"attributes": {
"hidden_elements": [
{
"type": "vote",
"hidden": true
},
{
"type": "emote",
"hidden": false
}
]
}
}
}'
Copy // Response: 204 No Content
Copy --url https://environment.monterosa.cloud/api/v2/projects/951a951e-07de-457f-99c8-f1307fad4eeb \
--header 'Authorization: Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb' \
--header 'Content-Type: application/vnd.api+json' \
--data '{
"data": {
"type": "projects",
"id": "951a951e-07de-457f-99c8-f1307fad4eeb",
"attributes": {
"hidden_elements": [
{
"type": "vote",
"hidden": true
},
{
"type": "emote",
"hidden": false
}
]
}
}
}'
In the example above elements of "vote" type is set to be invisible on UI and "emote" is set to be visible.
Settings for other element types not changed since hidden_elements
attribute contains settings only for "vote" and "emote".
It is similar to check "Emote" and uncheck "Vote" on Elements tab on Project Settings page .
Migrate a Project to a new App
A Project can be switched to another App by updating the App ID in the relationships
object.
Request Response
Copy curl -X PATCH https://environment.monterosa.cloud/api/v2/projects/a8e22ad3-b8b1-4fe2-a08a-45e5ba39df7d \
-d '{
"data": {
"type": "projects",
"id": "a8e22ad3-b8b1-4fe2-a08a-45e5ba39df7d",
"relationships": {
"app": {
"data": { "type": "apps", "id": "b9e22wd3-b8b1-4fe2-a08a-4ge5ba39df7d" }
}
}
}
}
'
Copy // Response: 204 No Content
Last updated 2 months ago