Forms
Submit Team Form
Submit a form opened with Open Team Form as the caller. On success the ticket is created exactly as a service catalog submission creates it, and the form’s workflow runs on that ticket. On a validation failure the form stays fillable and the errors say why.
POST
/
v2
/
team-forms
/
submit
Submit Team Form
curl --request POST \
--url https://public.api.serval.com/v2/team-forms/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"teamId": "<string>",
"formId": "<string>",
"formSessionId": "<string>",
"values": {}
}
'import requests
url = "https://public.api.serval.com/v2/team-forms/submit"
payload = {
"teamId": "<string>",
"formId": "<string>",
"formSessionId": "<string>",
"values": {}
}
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({teamId: '<string>', formId: '<string>', formSessionId: '<string>', values: {}})
};
fetch('https://public.api.serval.com/v2/team-forms/submit', 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://public.api.serval.com/v2/team-forms/submit",
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([
'teamId' => '<string>',
'formId' => '<string>',
'formSessionId' => '<string>',
'values' => [
]
]),
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://public.api.serval.com/v2/team-forms/submit"
payload := strings.NewReader("{\n \"teamId\": \"<string>\",\n \"formId\": \"<string>\",\n \"formSessionId\": \"<string>\",\n \"values\": {}\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://public.api.serval.com/v2/team-forms/submit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"teamId\": \"<string>\",\n \"formId\": \"<string>\",\n \"formSessionId\": \"<string>\",\n \"values\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public.api.serval.com/v2/team-forms/submit")
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 \"teamId\": \"<string>\",\n \"formId\": \"<string>\",\n \"formSessionId\": \"<string>\",\n \"values\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"submitted": true,
"errors": [
{
"fieldKey": "<string>",
"message": "<string>"
}
],
"form": {
"formSessionId": "<string>",
"formName": "<string>",
"ticketId": "<string>",
"status": "<string>",
"fields": [
{
"key": "<string>",
"label": "<string>",
"type": "<string>",
"required": true,
"readOnly": true,
"description": "<string>",
"options": [
{
"value": "<string>",
"label": "<string>",
"description": "<string>"
}
],
"value": {
"list": {
"values": [
"<string>"
]
}
},
"error": "<string>",
"validation": {
"format": "<string>",
"pattern": "<string>",
"message": "<string>",
"minLength": 123,
"maxLength": 123,
"min": 123,
"max": 123
}
}
],
"workflowCallId": "<string>"
},
"ticketId": "<string>"
}
}Authentication and permissions
Token requirements: User-based token (OAuth). Send a bearer access token for one of these identities. The permissions and resource restrictions below also apply.
| Credential | Access requirements |
|---|---|
| Organization-scoped API key | Unsupported |
| Workspace-scoped API key | Unsupported |
| User-based token (OAuth) | Supported, subject to permissions |
- Team form: The form must be listed in team_id’s service catalog and available to you. Submitting creates a ticket on team_id with you as its requester.
Authorizations
Body
application/json
Was this page helpful?
⌘I
Submit Team Form
curl --request POST \
--url https://public.api.serval.com/v2/team-forms/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"teamId": "<string>",
"formId": "<string>",
"formSessionId": "<string>",
"values": {}
}
'import requests
url = "https://public.api.serval.com/v2/team-forms/submit"
payload = {
"teamId": "<string>",
"formId": "<string>",
"formSessionId": "<string>",
"values": {}
}
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({teamId: '<string>', formId: '<string>', formSessionId: '<string>', values: {}})
};
fetch('https://public.api.serval.com/v2/team-forms/submit', 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://public.api.serval.com/v2/team-forms/submit",
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([
'teamId' => '<string>',
'formId' => '<string>',
'formSessionId' => '<string>',
'values' => [
]
]),
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://public.api.serval.com/v2/team-forms/submit"
payload := strings.NewReader("{\n \"teamId\": \"<string>\",\n \"formId\": \"<string>\",\n \"formSessionId\": \"<string>\",\n \"values\": {}\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://public.api.serval.com/v2/team-forms/submit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"teamId\": \"<string>\",\n \"formId\": \"<string>\",\n \"formSessionId\": \"<string>\",\n \"values\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public.api.serval.com/v2/team-forms/submit")
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 \"teamId\": \"<string>\",\n \"formId\": \"<string>\",\n \"formSessionId\": \"<string>\",\n \"values\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"submitted": true,
"errors": [
{
"fieldKey": "<string>",
"message": "<string>"
}
],
"form": {
"formSessionId": "<string>",
"formName": "<string>",
"ticketId": "<string>",
"status": "<string>",
"fields": [
{
"key": "<string>",
"label": "<string>",
"type": "<string>",
"required": true,
"readOnly": true,
"description": "<string>",
"options": [
{
"value": "<string>",
"label": "<string>",
"description": "<string>"
}
],
"value": {
"list": {
"values": [
"<string>"
]
}
},
"error": "<string>",
"validation": {
"format": "<string>",
"pattern": "<string>",
"message": "<string>",
"minLength": 123,
"maxLength": 123,
"min": 123,
"max": 123
}
}
],
"workflowCallId": "<string>"
},
"ticketId": "<string>"
}
}
