Create a Service
Create a Service
POST
/
v1
/
services
Create a Service
curl --request POST \
--url https://api.siit.io/v1/services \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"about": "<string>",
"enabled": true,
"category": "<string>",
"default_assignee": "<string>",
"sla_rule": "<string>",
"is_restricted_to_audience": true,
"audience": {
"matchers": [
{
"values": [
"<string>"
]
}
]
}
}
'import requests
url = "https://api.siit.io/v1/services"
payload = {
"name": "<string>",
"about": "<string>",
"enabled": True,
"category": "<string>",
"default_assignee": "<string>",
"sla_rule": "<string>",
"is_restricted_to_audience": True,
"audience": { "matchers": [{ "values": ["<string>"] }] }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
about: '<string>',
enabled: true,
category: '<string>',
default_assignee: '<string>',
sla_rule: '<string>',
is_restricted_to_audience: true,
audience: {matchers: [{values: ['<string>']}]}
})
};
fetch('https://api.siit.io/v1/services', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.siit.io/v1/services",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'about' => '<string>',
'enabled' => true,
'category' => '<string>',
'default_assignee' => '<string>',
'sla_rule' => '<string>',
'is_restricted_to_audience' => true,
'audience' => [
'matchers' => [
[
'values' => [
'<string>'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.siit.io/v1/services"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"about\": \"<string>\",\n \"enabled\": true,\n \"category\": \"<string>\",\n \"default_assignee\": \"<string>\",\n \"sla_rule\": \"<string>\",\n \"is_restricted_to_audience\": true,\n \"audience\": {\n \"matchers\": [\n {\n \"values\": [\n \"<string>\"\n ]\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.siit.io/v1/services")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"about\": \"<string>\",\n \"enabled\": true,\n \"category\": \"<string>\",\n \"default_assignee\": \"<string>\",\n \"sla_rule\": \"<string>\",\n \"is_restricted_to_audience\": true,\n \"audience\": {\n \"matchers\": [\n {\n \"values\": [\n \"<string>\"\n ]\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.siit.io/v1/services")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"about\": \"<string>\",\n \"enabled\": true,\n \"category\": \"<string>\",\n \"default_assignee\": \"<string>\",\n \"sla_rule\": \"<string>\",\n \"is_restricted_to_audience\": true,\n \"audience\": {\n \"matchers\": [\n {\n \"values\": [\n \"<string>\"\n ]\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"result": {
"sla_rule": "<string>",
"default_assignee": "<string>",
"uid": "<string>",
"about": "<string>",
"category": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"custom_form_input_configuration": [
{
"uid": "<string>",
"kind": "attachment",
"label": "<string>",
"multiple": true,
"options": [
"<string>"
],
"required": true,
"triggers_app_access": true
}
],
"is_restricted_to_audience": true,
"audience": {
"matchers": [
{
"data_point": "contract_type",
"comparator": "=",
"values": [
"<string>"
]
}
]
},
"enabled": true,
"name": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"troubleshoot": "<string>"
}Create a Service
curl --request POST \
--url https://api.siit.io/v1/services \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"about": "<string>",
"enabled": true,
"category": "<string>",
"default_assignee": "<string>",
"sla_rule": "<string>",
"is_restricted_to_audience": true,
"audience": {
"matchers": [
{
"values": [
"<string>"
]
}
]
}
}
'import requests
url = "https://api.siit.io/v1/services"
payload = {
"name": "<string>",
"about": "<string>",
"enabled": True,
"category": "<string>",
"default_assignee": "<string>",
"sla_rule": "<string>",
"is_restricted_to_audience": True,
"audience": { "matchers": [{ "values": ["<string>"] }] }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
about: '<string>',
enabled: true,
category: '<string>',
default_assignee: '<string>',
sla_rule: '<string>',
is_restricted_to_audience: true,
audience: {matchers: [{values: ['<string>']}]}
})
};
fetch('https://api.siit.io/v1/services', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.siit.io/v1/services",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'about' => '<string>',
'enabled' => true,
'category' => '<string>',
'default_assignee' => '<string>',
'sla_rule' => '<string>',
'is_restricted_to_audience' => true,
'audience' => [
'matchers' => [
[
'values' => [
'<string>'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.siit.io/v1/services"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"about\": \"<string>\",\n \"enabled\": true,\n \"category\": \"<string>\",\n \"default_assignee\": \"<string>\",\n \"sla_rule\": \"<string>\",\n \"is_restricted_to_audience\": true,\n \"audience\": {\n \"matchers\": [\n {\n \"values\": [\n \"<string>\"\n ]\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.siit.io/v1/services")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"about\": \"<string>\",\n \"enabled\": true,\n \"category\": \"<string>\",\n \"default_assignee\": \"<string>\",\n \"sla_rule\": \"<string>\",\n \"is_restricted_to_audience\": true,\n \"audience\": {\n \"matchers\": [\n {\n \"values\": [\n \"<string>\"\n ]\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.siit.io/v1/services")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"about\": \"<string>\",\n \"enabled\": true,\n \"category\": \"<string>\",\n \"default_assignee\": \"<string>\",\n \"sla_rule\": \"<string>\",\n \"is_restricted_to_audience\": true,\n \"audience\": {\n \"matchers\": [\n {\n \"values\": [\n \"<string>\"\n ]\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"result": {
"sla_rule": "<string>",
"default_assignee": "<string>",
"uid": "<string>",
"about": "<string>",
"category": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"custom_form_input_configuration": [
{
"uid": "<string>",
"kind": "attachment",
"label": "<string>",
"multiple": true,
"options": [
"<string>"
],
"required": true,
"triggers_app_access": true
}
],
"is_restricted_to_audience": true,
"audience": {
"matchers": [
{
"data_point": "contract_type",
"comparator": "=",
"values": [
"<string>"
]
}
]
},
"enabled": true,
"name": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"troubleshoot": "<string>"
}
