Api session event editor netsetting set owner: Difference between revisions

From Tygron Support wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 31: Line 31:
|}
|}
===Example POST===
===Example POST===
Example POST: https://engine.tygron.com/api/session/event/editornetsetting/set_owner/?f=JSON&token=API_TOKEN
Curl Example POST:


with content:  
<syntaxhighlight lang="text" copy>curl 'https://development.tygron.com/api/session/event/editornetsetting/set_owner/' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '[ "ELECTRICITY", 1 ]'
<pre>[ "ELECTRICITY", 74 ]
</syntaxhighlight>
</pre>
JavaScript Example POST:
 
<syntaxhighlight lang="text" copy>var options = {
 method: "POST",
 headers: { "Content-Type": "application/json", "Authorization": "Bearer 31410104zAuxtcJo8WGhL6iYlCDnU5hd" },
 body: '[ "ELECTRICITY", 1 ]'
};
fetch("https://development.tygron.com/api/session/event/editornetsetting/set_owner/", options)
 .then(response => response.text())
 .then(result => console.log(result))
 .catch(error => console.log('error', error));
</syntaxhighlight>
{{article end|seealso=*[[Api session event editor netsetting]]
{{article end|seealso=*[[Api session event editor netsetting]]
*[[Api session items netsettings]]
*[[Api session items netsettings]]

Revision as of 15:27, 8 April 2026

API Event to Set Owner

Name Importance Type Description Values
0 REQUIRED (Enumeration) NetType ELECTRICITY, GAS, HEAT, INTERNET or SEWER
1 REQUIRED (STAKEHOLDER Integer ID) Stakeholder

Response Codes

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

Example POST

Curl Example POST:

curl 'https://development.tygron.com/api/session/event/editornetsetting/set_owner/' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '[ "ELECTRICITY", 1 ]'

JavaScript Example POST:

var options = {
 method: "POST",
 headers: { "Content-Type": "application/json", "Authorization": "Bearer 31410104zAuxtcJo8WGhL6iYlCDnU5hd" },
 body: '[ "ELECTRICITY", 1 ]'
};
fetch("https://development.tygron.com/api/session/event/editornetsetting/set_owner/", options)
 .then(response => response.text())
 .then(result => console.log(result))
 .catch(error => console.log('error', error));