With this endpoint you are able to list all of your organizations interactions. If you want to list interactions from a particular collection, you can pass workspaceUid query parameter (ID of a collection).
Endpoint:
1
GET https://interactionbuilder.giosg.com/api/orgs/<organization_id>/interactions
Tag timestamp of interaction. This is used internally to track versions and make sure that multiple users don't override each others changes when saving.
project
object
Interaction definition. Only available when usingjson=true.
jsonVersion
integer
Giosg internal version of the interaction definition JSON. Only available when usingjson=true.
editorCanvasSizeType
string
Describes which editor canvas type was selected previously. One of "mobile1", "mobile2", "desktop1", "desktop2". Only available when usingjson=true.
previewUrl
string
Previously used URL to preview the interaction, can be null if preview url is not set. Only available when usingjson=true.
previewCanvasSizeType
string
Describes which preview canvas type was selected previously. One of "mobile1", "mobile2", "desktop1", "desktop2". Only available when usingjson=true.
previewCanvasRotated
boolean
If preview canvas is rotated to portrait mode. Only available when usingjson=true.
Tag to fetch. Tag is the same as interactions last updated at time from updatedDate field. If this field is specified and interaction has not been updated, then null will be returned. This is used to minimize data transmission if the client already has the correct interaction version. If interaction has been updated (tag does not match) then a full response will be returned.
Example:
1
GET https://interactionbuilder.giosg.com/api/interactions/e0976394-0781-4795-b052-bc8f66f149f8?tag=2021-03-15T10:34:28.819Z
Tag timestamp of interaction. This is used internally to track versions and make sure that multiple users don't override each others changes when saving.
project
object
Interaction definition.
jsonVersion
integer
Giosg internal version of the interaction definition JSON.
editorCanvasSizeType
string
Describes which editor canvas type was selected previously. One of "mobile1", "mobile2", "desktop1", "desktop2".
previewUrl
string
Previously used URL to preview the interaction, can be null if preview url is not set.
previewCanvasSizeType
string
Describes which preview canvas type was selected previously. One of "mobile1", "mobile2", "desktop1", "desktop2".
With this endpoint you are able to update existing interaction.
Endpoint:
1
POST https://interactionbuilder.giosg.com/api/interactions/<interaction_id>
1 2 3 4 5 6 7 8 910111213141516171819202122
importrequestsimportjson# Get existing interactionAPI_TOKEN="<api token>"INTERACTION_ID="<interaction id>"url="https://interactionbuilder.giosg.com/api/interactions/{}".format(INTERACTION_ID)response=requests.get(url,headers={'Authorization':'Token {}'.format(API_TOKEN),'Content-Type':'application/json',})response.raise_for_status()interaction=response.json()# Update name of the interactioninteraction["name"]="Updated interaction name"update_response=requests.post(url,json.dumps(interaction),headers={'Authorization':'Token {}'.format(API_TOKEN),'Content-Type':'application/json',})update_response.raise_for_status()print(update_response.json())
Tag timestamp of interaction. This is used internally to track versions and make sure that multiple users don't override each others changes when saving.
project
object
Interaction definition.
jsonVersion
integer
Giosg internal version of the interaction definition JSON.
editorCanvasSizeType
string
Describes which editor canvas type was selected previously. One of "mobile1", "mobile2", "desktop1", "desktop2".
previewUrl
string
Previously used URL to preview the interaction, can be null if preview url is not set.
previewCanvasSizeType
string
Describes which preview canvas type was selected previously. One of "mobile1", "mobile2", "desktop1", "desktop2".
Name for new interaction. If not set, name will be automatically generated from the copied interaction.
groupId
integer
optional
Target collection ID. If not set, will use same collection as the copied interaction.
forceUniqueName
boolean
optional
If set to true, a serial number will be added to copied interaction name if it is not unique otherwise. For example "Test" could become "Test 2". If not set or set to false, number will not be added.
With this endpoint you are able to create a new interaction. Creating a new interaction requires complex payload so it is highly recommended to fetch Interaction templates first and use one of those as payload.
If you want to create an empty interaction with this API, it is easiest to first fetch initial request payload using Interaction default project template API. It is recommended to always fetch default project for a base for the payload as the initial project payload may change over time.
Response of that endpoint then can be modified as user likes. API user also needs to add Collection ID to workspaceUid attribute and Theme ID to themeId attribute in order for the request to be successful.
Endpoint:
1
POST https://interactionbuilder.giosg.com/api/interactions/
1 2 3 4 5 6 7 8 910111213141516171819202122232425
importrequestsimportjsonAPI_TOKEN="<api token>"GROUP_ID="<group id>"THEME_ID="<theme id>"# Fetch default project template, this is optional but recommended.default_template_url="https://interactionbuilder.giosg.com/api/templates/default"template_response=requests.get(default_template_url,headers={'Authorization':'Token {}'.format(API_TOKEN),'Content-Type':'application/json',})payload=template_response.json()# Modify template name to liking and set collection and theme id'spayload["name"]="My awesome new interaction"payload["workspaceUid"]=GROUP_IDpayload["themeId"]=THEME_IDurl="https://interactionbuilder.giosg.com/api/interactions"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())
constAPI_TOKEN="<api token>";constGROUP_ID="<group id>";constTHEME_ID="<theme id>";// Fetch default project template, this is optional but recommended.constdefaultTemplateUrl=`https://interactionbuilder.giosg.com/api/templates/default`;consttemplateResponse=awaitfetch(defaultTemplateUrl,{headers:{"Content-Type":"application/json",Authorization:`Token ${API_TOKEN}`,},});consturl=`https://interactionbuilder.giosg.com/api/interactions`;// Modify template name to liking and set collection and theme id'sconstpayload={...awaittemplateResponse.json(),name:"My awesome new interaction",workspaceUid:GROUP_ID,themeId:THEME_ID,};constresponse=awaitfetch(url,{method:"POST",body:JSON.stringify(payload),headers:{"Content-Type":"application/json",Authorization:`Token ${API_TOKEN}`,},});console.log(awaitresponse.json());
Describes which editor canvas type should be set as default for interactions created using this template. One of "mobile1", "mobile2", "desktop1", "desktop2".
jsonVersion
integer
Required
Giosg internal version of the interaction template definition JSON.
templateName
string
Required
Name of the template that was used.
themeId
integer
Optional
ID of the theme object to be used. If no id is provided, then we'll use any theme we'll find in the collection or create a default theme if collection has no themes.
workspaceUid
integer
Required
ID of the collection this interaction should be placed to
With this endpoint you are able to publish interaction.
Publishing interaction always publishes latest version of interaction. For this reason there is optional query parameter called tag that can be used to prevent accidentally publishing other users changes.
Tag is basically a value from projects updatedDate field and when this value is provided, interaction will not be published if this value has changed. This is used to prevent accidentally publishing changes that other users may have made to interaction at the same time.
Endpoint:
1
POST https://interactionbuilder.giosg.com/api/interactions/<interaction_id>/publish?tag=2021-03-01T14:20:46.970Z
1 2 3 4 5 6 7 8 910111213
importrequestsimportjsonAPI_TOKEN="<api token>"INTERACTION_ID="<interaction id>"TAG="<tag to publish>"url="https://interactionbuilder.giosg.com/api/interactions/{}/publish?tag={}".format(INTERACTION_ID,TAG)response=requests.post(url,data=json.dumps({}),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 910111213
constAPI_TOKEN="<api token>";constINTERACTION_ID="<interaction id>";constTAG="<tag to publish>";consturl=`https://interactionbuilder.giosg.com/api/interactions/${INTERACTION_ID}/publish?tag=${TAG}`;constresponse=awaitfetch(url,{method:"POST",body:JSON.stringify({}),headers:{"Content-Type":"application/json",Authorization:`Token ${API_TOKEN}`,},});console.log(awaitresponse.json());
Tag to publish. If this is omitted, then latest interaction version is published without any additional checks. Tag is same as interactions last updated at time from updatedDate field.
With this endpoint you are able to unpublish an interaction. This won't delete any rules that might have been setup to show the interaction, but does prevent the interaction to be loaded by the rules.
Unpublishing an interaction will always unpublish the latest published version of an interaction. For this reason there is optional query parameter called tag that can be used to prevent accidentally unpublishing version that other user has published simultaneously.
Tag is basically a value from projects updatedDate field and when this value is provided, interaction will not be unpublished if this value has changed.
Endpoint:
1
POST https://interactionbuilder.giosg.com/api/interactions/<interaction_id>/unpublish?tag=2021-03-01T14:20:46.970Z
1 2 3 4 5 6 7 8 910111213
importrequestsimportjsonAPI_TOKEN="<api token>"INTERACTION_ID="<interaction id>"TAG="<tag to publish>"url="https://interactionbuilder.giosg.com/api/interactions/{}/unpublish?tag={}".format(INTERACTION_ID,TAG)response=requests.post(url,data=json.dumps({}),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 910111213
constAPI_TOKEN="<api token>";constINTERACTION_ID="<interaction id>";constTAG="<tag to publish>";consturl=`https://interactionbuilder.giosg.com/api/interactions/${INTERACTION_ID}/unpublish?tag=${TAG}`;constresponse=awaitfetch(url,{method:"POST",body:JSON.stringify({}),headers:{"Content-Type":"application/json",Authorization:`Token ${API_TOKEN}`,},});console.log(awaitresponse.json());
Tag to unpublish. If this is omitted, then latest published version of interaction gets unpublished without any additional checks. Tag is same as interactions last updated at time from updatedDate field.
Revert an interaction to previously published state¶
With this endpoint you are able to revert the changes of an interaction to the previously published state. Reverting is not possible if the interaction has not been published yet.
Reverting interaction always reverts it to latest published version of interaction.
Endpoint:
1
POST https://interactionbuilder.giosg.com/api/interactions/<interaction_id>/revert
With this endpoint you are able to list interaction templates. Templates can help you while creating a new interaction. It is recommended to use templates with the Create a new interaction API to make it easier to build the correct payload.
Endpoint:
1
GET https://interactionbuilder.giosg.com/api/templates
Tag timestamp of interaction template. This is used internally to track versions and make sure that multiple users don't override each others changes when saving.
project
object
Interaction template definition. This is the payload that can be used to create new interaction from.
jsonVersion
integer
Giosg internal version of the interaction template definition JSON.
editorCanvasSizeType
string
Describes which editor canvas type should be set as default for interactions created using this template. One of "mobile1", "mobile2", "desktop1", "desktop2".
previewUrl
string
Preview url is null for interaction templates
previewCanvasSizeType
string
Preview canvas type is null for interaction templates
previewCanvasRotated
boolean
false for interaction templates
workspaceUid
integer
ID of the collection this interaction template belongs to
With this endpoint you are able to get default interaction project template. This can be used to create a new interactions with the Create a new interaction API.
This is different from a template since a template is already filled with a basic layout, while this endpoint will return an empty interaction.
Endpoint:
1
GET https://interactionbuilder.giosg.com/api/templates/default
Response will be a object with following attributes:
Attribute
Type
Description
name
string
Name of the interaction template
templateName
string
Name of the template used, null always for template interactions.
project
object
Interaction template definition. This is the payload that can be used to create new interaction from.
jsonVersion
integer
Giosg internal version of the interaction template definition JSON.
editorCanvasSizeType
string
Describes which editor canvas type should be set as default for interactions created using this template. One of "mobile1", "mobile2", "desktop1", "desktop2".