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.

Name Importance Type Description Values
0 REQUIRED (STAKEHOLDER Integer ID) Stakeholder ID
1 REQUIRED (ZONE Integer ID or multiple 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, [ [ "NATURE", "PARK" ], [ "NATURE", "AGRICULTURE" ], [ "PARK", "NATURE" ] ] ]'

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 ], [ [ "LEISURE", "SENIOR" ], [ "LEISURE", "OTHER" ], [ "SENIOR", "LEISURE" ] ] ]'

JavaScript example POST:

var options = {
 method: "POST",
 headers: { "Content-Type": "application/json", "Authorization": "Bearer API_TOKEN" },
 body: '[ 1, 1, [ [ "NATURE", "PARK" ], [ "NATURE", "AGRICULTURE" ], [ "PARK", "NATURE" ] ] ]'
};
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));