curl --request PATCH \
--url https://api.siftstack.com/api/v1/user-defined-functions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"userDefinedFunction": {
"userDefinedFunctionId": "<string>",
"name": "<string>",
"userDefinedFunctionVersionId": "<string>",
"version": 123,
"description": "<string>",
"changeMessage": "<string>",
"userNotes": "<string>",
"expression": "<string>",
"functionInputs": [
{
"identifier": "<string>",
"dataType": "FUNCTION_DATA_TYPE_UNSPECIFIED",
"constant": true
}
],
"functionDependencies": [
{
"userDefinedFunctionVersionId": "<string>"
}
],
"createdDate": "2023-11-07T05:31:56Z",
"modifiedDate": "2023-11-07T05:31:56Z",
"createdByUserId": "<string>",
"modifiedByUserId": "<string>",
"metadata": [
{
"key": {
"name": "<string>",
"type": "METADATA_KEY_TYPE_UNSPECIFIED",
"archivedDate": "2023-11-07T05:31:56Z",
"isArchived": true
},
"stringValue": "<string>",
"numberValue": 123,
"booleanValue": true,
"archivedDate": "2023-11-07T05:31:56Z",
"isArchived": true
}
],
"isArchived": true,
"archivedDate": "2023-11-07T05:31:56Z",
"functionOutputType": "FUNCTION_DATA_TYPE_UNSPECIFIED"
},
"updateMask": "<string>"
}
'import requests
url = "https://api.siftstack.com/api/v1/user-defined-functions"
payload = {
"userDefinedFunction": {
"userDefinedFunctionId": "<string>",
"name": "<string>",
"userDefinedFunctionVersionId": "<string>",
"version": 123,
"description": "<string>",
"changeMessage": "<string>",
"userNotes": "<string>",
"expression": "<string>",
"functionInputs": [
{
"identifier": "<string>",
"dataType": "FUNCTION_DATA_TYPE_UNSPECIFIED",
"constant": True
}
],
"functionDependencies": [{ "userDefinedFunctionVersionId": "<string>" }],
"createdDate": "2023-11-07T05:31:56Z",
"modifiedDate": "2023-11-07T05:31:56Z",
"createdByUserId": "<string>",
"modifiedByUserId": "<string>",
"metadata": [
{
"key": {
"name": "<string>",
"type": "METADATA_KEY_TYPE_UNSPECIFIED",
"archivedDate": "2023-11-07T05:31:56Z",
"isArchived": True
},
"stringValue": "<string>",
"numberValue": 123,
"booleanValue": True,
"archivedDate": "2023-11-07T05:31:56Z",
"isArchived": True
}
],
"isArchived": True,
"archivedDate": "2023-11-07T05:31:56Z",
"functionOutputType": "FUNCTION_DATA_TYPE_UNSPECIFIED"
},
"updateMask": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.siftstack.com/api/v1/user-defined-functions"
payload := strings.NewReader("{\n \"userDefinedFunction\": {\n \"userDefinedFunctionId\": \"<string>\",\n \"name\": \"<string>\",\n \"userDefinedFunctionVersionId\": \"<string>\",\n \"version\": 123,\n \"description\": \"<string>\",\n \"changeMessage\": \"<string>\",\n \"userNotes\": \"<string>\",\n \"expression\": \"<string>\",\n \"functionInputs\": [\n {\n \"identifier\": \"<string>\",\n \"dataType\": \"FUNCTION_DATA_TYPE_UNSPECIFIED\",\n \"constant\": true\n }\n ],\n \"functionDependencies\": [\n {\n \"userDefinedFunctionVersionId\": \"<string>\"\n }\n ],\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"modifiedDate\": \"2023-11-07T05:31:56Z\",\n \"createdByUserId\": \"<string>\",\n \"modifiedByUserId\": \"<string>\",\n \"metadata\": [\n {\n \"key\": {\n \"name\": \"<string>\",\n \"type\": \"METADATA_KEY_TYPE_UNSPECIFIED\",\n \"archivedDate\": \"2023-11-07T05:31:56Z\",\n \"isArchived\": true\n },\n \"stringValue\": \"<string>\",\n \"numberValue\": 123,\n \"booleanValue\": true,\n \"archivedDate\": \"2023-11-07T05:31:56Z\",\n \"isArchived\": true\n }\n ],\n \"isArchived\": true,\n \"archivedDate\": \"2023-11-07T05:31:56Z\",\n \"functionOutputType\": \"FUNCTION_DATA_TYPE_UNSPECIFIED\"\n },\n \"updateMask\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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))
}{
"userDefinedFunction": {
"userDefinedFunctionId": "<string>",
"name": "<string>",
"userDefinedFunctionVersionId": "<string>",
"version": 123,
"description": "<string>",
"changeMessage": "<string>",
"userNotes": "<string>",
"expression": "<string>",
"functionInputs": [
{
"identifier": "<string>",
"dataType": "FUNCTION_DATA_TYPE_UNSPECIFIED",
"constant": true
}
],
"functionDependencies": [
{
"userDefinedFunctionVersionId": "<string>"
}
],
"createdDate": "2023-11-07T05:31:56Z",
"modifiedDate": "2023-11-07T05:31:56Z",
"createdByUserId": "<string>",
"modifiedByUserId": "<string>",
"metadata": [
{
"key": {
"name": "<string>",
"type": "METADATA_KEY_TYPE_UNSPECIFIED",
"archivedDate": "2023-11-07T05:31:56Z",
"isArchived": true
},
"stringValue": "<string>",
"numberValue": 123,
"booleanValue": true,
"relationValue": {
"resourceType": "<string>",
"resourceId": "<string>"
},
"archivedDate": "2023-11-07T05:31:56Z",
"isArchived": true
}
],
"isArchived": true,
"archivedDate": "2023-11-07T05:31:56Z",
"functionOutputType": "FUNCTION_DATA_TYPE_UNSPECIFIED"
}
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}UpdateUserDefinedFunction
Update and create a new version of a user defined function.
curl --request PATCH \
--url https://api.siftstack.com/api/v1/user-defined-functions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"userDefinedFunction": {
"userDefinedFunctionId": "<string>",
"name": "<string>",
"userDefinedFunctionVersionId": "<string>",
"version": 123,
"description": "<string>",
"changeMessage": "<string>",
"userNotes": "<string>",
"expression": "<string>",
"functionInputs": [
{
"identifier": "<string>",
"dataType": "FUNCTION_DATA_TYPE_UNSPECIFIED",
"constant": true
}
],
"functionDependencies": [
{
"userDefinedFunctionVersionId": "<string>"
}
],
"createdDate": "2023-11-07T05:31:56Z",
"modifiedDate": "2023-11-07T05:31:56Z",
"createdByUserId": "<string>",
"modifiedByUserId": "<string>",
"metadata": [
{
"key": {
"name": "<string>",
"type": "METADATA_KEY_TYPE_UNSPECIFIED",
"archivedDate": "2023-11-07T05:31:56Z",
"isArchived": true
},
"stringValue": "<string>",
"numberValue": 123,
"booleanValue": true,
"archivedDate": "2023-11-07T05:31:56Z",
"isArchived": true
}
],
"isArchived": true,
"archivedDate": "2023-11-07T05:31:56Z",
"functionOutputType": "FUNCTION_DATA_TYPE_UNSPECIFIED"
},
"updateMask": "<string>"
}
'import requests
url = "https://api.siftstack.com/api/v1/user-defined-functions"
payload = {
"userDefinedFunction": {
"userDefinedFunctionId": "<string>",
"name": "<string>",
"userDefinedFunctionVersionId": "<string>",
"version": 123,
"description": "<string>",
"changeMessage": "<string>",
"userNotes": "<string>",
"expression": "<string>",
"functionInputs": [
{
"identifier": "<string>",
"dataType": "FUNCTION_DATA_TYPE_UNSPECIFIED",
"constant": True
}
],
"functionDependencies": [{ "userDefinedFunctionVersionId": "<string>" }],
"createdDate": "2023-11-07T05:31:56Z",
"modifiedDate": "2023-11-07T05:31:56Z",
"createdByUserId": "<string>",
"modifiedByUserId": "<string>",
"metadata": [
{
"key": {
"name": "<string>",
"type": "METADATA_KEY_TYPE_UNSPECIFIED",
"archivedDate": "2023-11-07T05:31:56Z",
"isArchived": True
},
"stringValue": "<string>",
"numberValue": 123,
"booleanValue": True,
"archivedDate": "2023-11-07T05:31:56Z",
"isArchived": True
}
],
"isArchived": True,
"archivedDate": "2023-11-07T05:31:56Z",
"functionOutputType": "FUNCTION_DATA_TYPE_UNSPECIFIED"
},
"updateMask": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.siftstack.com/api/v1/user-defined-functions"
payload := strings.NewReader("{\n \"userDefinedFunction\": {\n \"userDefinedFunctionId\": \"<string>\",\n \"name\": \"<string>\",\n \"userDefinedFunctionVersionId\": \"<string>\",\n \"version\": 123,\n \"description\": \"<string>\",\n \"changeMessage\": \"<string>\",\n \"userNotes\": \"<string>\",\n \"expression\": \"<string>\",\n \"functionInputs\": [\n {\n \"identifier\": \"<string>\",\n \"dataType\": \"FUNCTION_DATA_TYPE_UNSPECIFIED\",\n \"constant\": true\n }\n ],\n \"functionDependencies\": [\n {\n \"userDefinedFunctionVersionId\": \"<string>\"\n }\n ],\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"modifiedDate\": \"2023-11-07T05:31:56Z\",\n \"createdByUserId\": \"<string>\",\n \"modifiedByUserId\": \"<string>\",\n \"metadata\": [\n {\n \"key\": {\n \"name\": \"<string>\",\n \"type\": \"METADATA_KEY_TYPE_UNSPECIFIED\",\n \"archivedDate\": \"2023-11-07T05:31:56Z\",\n \"isArchived\": true\n },\n \"stringValue\": \"<string>\",\n \"numberValue\": 123,\n \"booleanValue\": true,\n \"archivedDate\": \"2023-11-07T05:31:56Z\",\n \"isArchived\": true\n }\n ],\n \"isArchived\": true,\n \"archivedDate\": \"2023-11-07T05:31:56Z\",\n \"functionOutputType\": \"FUNCTION_DATA_TYPE_UNSPECIFIED\"\n },\n \"updateMask\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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))
}{
"userDefinedFunction": {
"userDefinedFunctionId": "<string>",
"name": "<string>",
"userDefinedFunctionVersionId": "<string>",
"version": 123,
"description": "<string>",
"changeMessage": "<string>",
"userNotes": "<string>",
"expression": "<string>",
"functionInputs": [
{
"identifier": "<string>",
"dataType": "FUNCTION_DATA_TYPE_UNSPECIFIED",
"constant": true
}
],
"functionDependencies": [
{
"userDefinedFunctionVersionId": "<string>"
}
],
"createdDate": "2023-11-07T05:31:56Z",
"modifiedDate": "2023-11-07T05:31:56Z",
"createdByUserId": "<string>",
"modifiedByUserId": "<string>",
"metadata": [
{
"key": {
"name": "<string>",
"type": "METADATA_KEY_TYPE_UNSPECIFIED",
"archivedDate": "2023-11-07T05:31:56Z",
"isArchived": true
},
"stringValue": "<string>",
"numberValue": 123,
"booleanValue": true,
"relationValue": {
"resourceType": "<string>",
"resourceId": "<string>"
},
"archivedDate": "2023-11-07T05:31:56Z",
"isArchived": true
}
],
"isArchived": true,
"archivedDate": "2023-11-07T05:31:56Z",
"functionOutputType": "FUNCTION_DATA_TYPE_UNSPECIFIED"
}
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The request for a call to UserDefinedFunctionService_UpdateUserDefinedFunction to update a user defined function. Updating a user
defined function creates a new version of the user defined function, leaving the previous untouched. If no update is deemed necessary, then the
the current version is returned. If name is changed then only name will be changed. If archive date is changed then only archive date will be changed.
To archive user defined function, specify archived_date in the update mask as well as a non-null value for archived_date in the
user_defined_function object. To unarchive a user defined function, specify archived_date in the update mask and a null value for archived_date
in the user_defined_function object. Alternatively, use is_archived with a boolean value to archive/unarchive.
The request for a call to UserDefinedFunctionService_UpdateUserDefinedFunction to update a user defined function. Updating a user
defined function creates a new version of the user defined function, leaving the previous untouched. If no update is deemed necessary, then the
the current version is returned. If name is changed then only name will be changed. If archive date is changed then only archive date will be changed.
To archive user defined function, specify archived_date in the update mask as well as a non-null value for archived_date in the
user_defined_function object. To unarchive a user defined function, specify archived_date in the update mask and a null value for archived_date
in the user_defined_function object. Alternatively, use is_archived with a boolean value to archive/unarchive.
Response
A successful response.
Show child attributes
Show child attributes
Was this page helpful?