Skip to content

Collections API

Overview

Interaction Designer collections API provides access to collections, eg. groups of interactions.

List collections

With this endpoint you are able to list all of your organizations collections.

Endpoint:

1
GET https://interactiondesigner.giosg.com/api/v1/collections

1
2
3
4
5
6
7
8
9
import requests

API_TOKEN = "<api token>"
url = "https://interactiondesigner.giosg.com/api/v1/collections"
response = requests.get(url, headers={
    'Authorization': 'Token {}'.format(API_TOKEN)
})
response.raise_for_status()
print(response.json())
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
const API_TOKEN = "<api token>";
const ORGANIZATION_ID = "<organization id>";
const url = `https://interactiondesigner.giosg.com/api/v1/collections`;
const response = await fetch(url, {
    headers: {
        "Content-Type": "application/json",
        Authorization: `Token ${API_TOKEN}`,
    },
});
console.log(await response.json());

Response

Response is a Array of following objects:

Attribute Type Description
id integer Collection ID
name string Name of the collection
dataRetentionDays integer How many days form submission data is retained before automatically removed, null if automatic data disposal is disabled.
dataDisposalEnabled boolean Is automatic data disposal enabled
organizationUid string UUID string of the collection owner organization
sharedWithPartnerOrganizationUid string UUID string of the organization which the collection is shared with, null if not shared.
sharedWithPartnerReadwrite boolean If true, share receiver is able to modify interactions in this collection.
sharedWithSupport boolean Giosg internal attribute. true if this collection is shared to Giosg support team.

Get single collection

With this endpoint you are able to get details of single collection.

Endpoint:

1
GET https://interactiondesigner.giosg.com/api/v1/collections/<collection_id>

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
import requests

API_TOKEN = "<api token>"
COLLECTION_ID = "<collection id>"
url = "https://interactiondesigner.giosg.com/api/v1/collections/{}".format(COLLECTION_ID)
response = requests.get(url, headers={
    'Authorization': 'Token {}'.format(API_TOKEN)
})
response.raise_for_status()
print(response.json())
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
const API_TOKEN = "<api token>";
const COLLECTION_ID = "<collection id>";
const url = `https://interactiondesigner.giosg.com/api/v1/collections/${COLLECTION_ID}`;
const response = await fetch(url, {
    headers: {
        "Content-Type": "application/json",
        Authorization: `Token ${API_TOKEN}`,
    },
});
console.log(await response.json());

Response

Attribute Type Description
id integer Collection ID
name string Name of the collection
dataRetentionDays integer How many days form submission data is retained before automatically removed, null if automatic data disposal is disabled.
dataDisposalEnabled boolean Is automatic data disposal enabled
organizationUid string UUID string of the collection owner organization
sharedWithPartnerOrganizationUid string UUID string of the organization which the collection is shared with, null if not shared.
sharedWithPartnerReadwrite boolean If true, share receiver is able to modify interactions in this collection.
sharedWithSupport boolean Giosg internal attribute. true if this collection is shared to Giosg support team.

Delete collection

With this endpoint it is possible to delete a collection. Note that deleting collection is not possible if it contains any interactions or themes. To delete collection, first delete or move all interactions from it and delete all themes in the collection.

Endpoint:

1
DELETE https://interactiondesigner.giosg.com/api/v1/collections/<collection_id>

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
import requests

API_TOKEN = "<api token>"
COLLECTION_ID = "<collection id>"
url = "https://interactiondesigner.giosg.com/api/v1/collections/{}".format(COLLECTION_ID)
response = requests.delete(url, headers={
    'Authorization': 'Token {}'.format(API_TOKEN)
})
response.raise_for_status()
print(response.status_code)
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
const API_TOKEN = "<api token>";
const COLLECTION_ID = "<collection id>";
const url = `https://interactiondesigner.giosg.com/api/v1/collections/${COLLECTION_ID}`;
const response = await fetch(url, {
    method: "DELETE",
    headers: {
        "Content-Type": "application/json",
        Authorization: `Token ${API_TOKEN}`,
    },
});
console.log(await response.status);

Create a new collection

With this endpoint you are able to create new collections for your interactions.

Endpoint:

1
POST https://interactiondesigner.giosg.com/api/v1/collections/

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
import requests
import json

API_TOKEN = "<api token>"
url = "https://interactiondesigner.giosg.com/api/v1/collections"
payload = {
    "name": "My new collection"
}
response = requests.post(url, data=json.dumps(payload), headers={
    'Authorization': 'Token {}'.format(API_TOKEN),
    'Content-Type': 'application/json',
})
response.raise_for_status()
print(response.json())
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
const API_TOKEN = "<api token>";
const url = `https://interactiondesigner.giosg.com/api/v1/collections`;
const payload = {
    name: "My new collection"
};
const response = await fetch(url, {
    method: "POST",
    body: JSON.stringify(payload),
    headers: {
        "Content-Type": "application/json",
        Authorization: `Token ${API_TOKEN}`,
    },
});
console.log(await response.json());

Request parameters

Parameter Type Required Description
name string Required Name of the collection to create
dataRetentionDays integer Optional How many days form submission data is retained before automatically removed, null if automatic data disposal is disabled.
dataDisposalEnabled boolean Optional Is automatic data disposal enabled
organizationUid string Optional UUID string of the collection owner organization
sharedWithPartnerOrganizationUid string Optional UUID string of the organization which the collection is shared with, null if not shared.
sharedWithPartnerReadwrite boolean Optional If true, share receiver is able to modify interactions in this collection.
sharedWithSupport boolean Optional Giosg internal attribute. true if this collection is shared to Giosg support team.

Response

Attribute Type Description
id integer Collection ID
name string Name of the collection
dataRetentionDays integer How many days form submission data is retained before automatically removed, null if automatic data disposal is disabled.
dataDisposalEnabled boolean Is automatic data disposal enabled
organizationUid string UUID string of the collection owner organization
sharedWithPartnerOrganizationUid string UUID string of the organization which the collection is shared with, null if not shared.
sharedWithPartnerReadwrite boolean If true, share receiver is able to modify interactions in this collection.
sharedWithSupport boolean Giosg internal attribute. true if this collection is shared to Giosg support team.

Update a collection

With this endpoint you are able to update existing collections.

Endpoint:

1
POST https://interactiondesigner.giosg.com/api/v1/collections/<collection_id>

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
import requests
import json

API_TOKEN = "<api token>"
COLLECTION_ID = "<collection id>"
url = "https://interactiondesigner.giosg.com/api/v1/collections/{}".format(COLLECTION_ID)
payload = {
    "name": "My updated collection name",
    "dataRetentionDays": 100,
    "dataDisposalEnabled": True

}
response = requests.post(url, data=json.dumps(payload), headers={
    'Authorization': 'Token {}'.format(API_TOKEN),
    'Content-Type': 'application/json',
})
response.raise_for_status()
print(response.json())
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
const API_TOKEN = "<api token>";
const COLLECTION_ID = "<collection id>";
const url = `https://interactiondesigner.giosg.com/api/v1/collections/${COLLECTION_ID}`;
const payload = {
    name: "My updated collection name",
    dataRetentionDays: 100,
    dataDisposalEnabled: True

};
const response = await fetch(url, {
    method: "POST",
    body: JSON.stringify(payload),
    headers: {
        "Content-Type": "application/json",
        Authorization: `Token ${API_TOKEN}`,
    },
});
console.log(await response.json());

Request parameters

Parameter Type Required Description
name string Required Name of the collection to create
dataRetentionDays integer Optional How many days form submission data is retained before automatically removed, null if automatic data disposal is disabled.
dataDisposalEnabled boolean Optional Is automatic data disposal enabled
organizationUid string Optional UUID string of the collection owner organization
sharedWithPartnerOrganizationUid string Optional UUID string of the organization which the collection is shared with, null if not shared.
sharedWithPartnerReadwrite boolean Optional If true, share receiver is able to modify interactions in this collection.
sharedWithSupport boolean Optional Giosg internal attribute. true if this collection is shared to Giosg support team.

Response

Attribute Type Description
id integer Collection ID
name string Name of the collection
dataRetentionDays integer How many days form submission data is retained before automatically removed, null if automatic data disposal is disabled.
dataDisposalEnabled boolean Is automatic data disposal enabled
organizationUid string UUID string of the collection owner organization
sharedWithPartnerOrganizationUid string UUID string of the organization which the collection is shared with, null if not shared.
sharedWithPartnerReadwrite boolean If true, share receiver is able to modify interactions in this collection.
sharedWithSupport boolean Giosg internal attribute. true if this collection is shared to Giosg support team.