Api session event participant zones set categories

From Tygron Support wiki
Jump to navigation Jump to search

API Endpoint: api/session/event/participant/zones_set_categories/

Description: Sets the allowed Building categories for specified Zones.

Index Importance Type Description Values
0 REQUIRED (STAKEHOLDER Integer ID) Stakeholder ID
1 REQUIRED (ZONE Integer ID or multiple integer values in array [1, 2, 3]) Zone IDs
2 REQUIRED (Category or multiple values in array [a, b, c]) Array of Category Arrays

Response Codes

Response Code: Description
204 No Content
300-600 Codes Overview

Example POST

Curl example POST

curl 'https://engine.tygron.com/api/session/event/participant/zones_set_categories/' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '[ 1, 1, [ [ "PAVED_AREA", "UNDERGROUND" ], [ "PAVED_AREA", "ROAD" ], [ "UNDERGROUND", "PAVED_AREA" ] ] ]'

Curl example multi item POST

curl 'https://engine.tygron.com/api/session/event/participant/zones_set_categories/' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '[ 1, [ 1, 2, 3 ], [ [ "INTERSECTION", "STUDENT" ], [ "INTERSECTION", "INDUSTRY" ], [ "STUDENT", "INTERSECTION" ] ] ]'

JavaScript example POST

var options = {
 method: "POST",
 headers: { "Content-Type": "application/json", "Authorization": "Bearer API_TOKEN" },
 body: '[ 1, 1, [ [ "PAVED_AREA", "UNDERGROUND" ], [ "PAVED_AREA", "ROAD" ], [ "UNDERGROUND", "PAVED_AREA" ] ] ]'
};
fetch("https://engine.tygron.com/api/session/event/participant/zones_set_categories/", options)
 .then(response => response.text())
 .then(result => console.log(result))
 .catch(error => console.log('error', error));