Action specifications for links
What actions need to be specified?
Links support the exact same set of actions as services, that is: create, update, delete, and custom actions.
How should I implement these actions?
Creating action specifications for a link is exactly the same process you follow when you create your service's actions.
The only consideration is that instead of using URLs like:
/service_specification/:id/action_specification
you will use URLs like:
/link_specification/:id/action_specification
For more info on how service actions work, refer to the action specifications docs.
Link action specifications
Action specifications for links work exactly the same way as they do for services. Here are examples for create, update, delete, and custom link actions.
Create
- CLI
- cURL
np link-specification action-specification create \
--linkSpecificationId $link_spec_id \
--body '{
"name": "Create my link action spec",
"type": "create",
"parameters": { // defines the input requirements for the action.
"schema": {
"type": "object",
"properties": {
"my_string_property": {
"type": "string"
},
"my_number_property": {
"type": "number",
"default": 0
}
},
"required": [
"my_string_property"
]
},
"values": {}
},
"results": { // defines the expected output of the action.
"schema": {
"type": "object",
"properties": {
"my_string_property": {
"type": "string"
},
"my_number_property": {
"type": "number",
"default": 0
}
},
"required": [
"my_string_property"
]
},
"values": {}
},
"service_specification_id": "134544a6-a089-43ba-9d52-5b6e6e4fa8d1", // the associated service specification
"link_specification_id": "f3e8be90-0952-4506-bd54-c4e75a5a4393" // the associated link specification
}'
curl -X POST "https://api.nullplatform.com/link_specification/$link_spec_id/action_specification" \
-H "Content-Type: application/json" \
-d '{
"name": "Create my link action",
"type": "create",
"parameters": { // defines the input requirements for the action.
"schema": {
"type": "object",
"properties": {
"my_string_property": {
"type": "string"
},
"my_number_property": {
"type": "number",
"default": 0
}
},
"required": [
"my_string_property"
]
},
"values": {}
},
"results": { // defines the expected output of the action.
"schema": {
"type": "object",
"properties": {
"my_string_property": {
"type": "string"
},
"my_number_property": {
"type": "number",
"default": 0
}
},
"required": [
"my_string_property"
]
},
"values": {}
},
"service_specification_id": "134544a6-a089-43ba-9d52-5b6e6e4fa8d1", // the associated service specification
"link_specification_id": "f3e8be90-0952-4506-bd54-c4e75a5a4393" // the associated link specification
}'
Delete
- CLI
- cURL
np link-specification action-specification create \
--linkSpecificationId $link_spec_id \
--body '{
"name": "Create my link delete action spec",
"type": "delete",
"parameters": { // defines the input requirements for the action.
"schema": {
"type": "object",
"properties": {
"my_string_property": {
"type": "string"
},
"my_number_property": {
"type": "number",
"default": 0
}
},
"required": [
"my_string_property"
]
},
"values": {}
},
"results": { // defines the expected output of the action.
"schema": {
"type": "object",
"properties": {
"my_string_property": {
"type": "string"
},
"my_number_property": {
"type": "number",
"default": 0
}
},
"required": [
"my_string_property"
]
},
"values": {}
},
"service_specification_id": "134544a6-a089-43ba-9d52-5b6e6e4fa8d1", // the associated service specification
"link_specification_id": "f3e8be90-0952-4506-bd54-c4e75a5a4393" // the associated link specification
}'
curl -X POST "https://api.nullplatform.com/link_specification/$link_spec_id/action_specification" \
-H "Content-Type: application/json" \
-d '{
"name": "Create my link delete action spec",
"type": "delete",
"parameters": { // defines the input requirements for the action.
"schema": {
"type": "object",
"properties": {
"my_string_property": {
"type": "string"
},
"my_number_property": {
"type": "number",
"default": 0
}
},
"required": [
"my_string_property"
]
},
"values": {}
},
"results": { // defines the expected output of the action.
"schema": {
"type": "object",
"properties": {
"my_string_property": {
"type": "string"
},
"my_number_property": {
"type": "number",
"default": 0
}
},
"required": [
"my_string_property"
]
},
"values": {}
},
"service_specification_id": "134544a6-a089-43ba-9d52-5b6e6e4fa8d1", // the associated service specification
"link_specification_id": "f3e8be90-0952-4506-bd54-c4e75a5a4393" // the associated link specification
}'
Update
- CLI
- cURL
np link-specification action-specification create \
--linkSpecificationId $link_spec_id \
--body '{
"name": "Create my link update action spec",
"type": "update",
"parameters": { // defines the input requirements for the action.
"schema": {
"type": "object",
"properties": {
"my_string_property": {
"type": "string"
},
"my_number_property": {
"type": "number",
"default": 0
}
},
"required": [
"my_string_property"
]
},
"values": {}
},
"results": { // defines the expected output of the action.
"schema": {
"type": "object",
"properties": {
"my_string_property": {
"type": "string"
},
"my_number_property": {
"type": "number",
"default": 0
}
},
"required": [
"my_string_property"
]
},
"values": {}
},
"service_specification_id": "134544a6-a089-43ba-9d52-5b6e6e4fa8d1", // the associated service specification
"link_specification_id": "f3e8be90-0952-4506-bd54-c4e75a5a4393" // the associated link specification
}'
curl -X POST "https://api.nullplatform.com/link_specification/$link_spec_id/action_specification" \
-H "Content-Type: application/json" \
-d '{
"name": "Create my link update action spec",
"type": "update",
"parameters": { // defines the input requirements for the action.
"schema": {
"type": "object",
"properties": {
"my_string_property": {
"type": "string"
},
"my_number_property": {
"type": "number",
"default": 0
}
},
"required": [
"my_string_property"
]
},
"values": {}
},
"results": { // defines the expected output of the action.
"schema": {
"type": "object",
"properties": {
"my_string_property": {
"type": "string"
},
"my_number_property": {
"type": "number",
"default": 0
}
},
"required": [
"my_string_property"
]
},
"values": {}
},
"service_specification_id": "134544a6-a089-43ba-9d52-5b6e6e4fa8d1", // the associated service specification
"link_specification_id": "f3e8be90-0952-4506-bd54-c4e75a5a4393" // the associated link specification
}'
Custom
- CLI
- cURL
np link-specification action-specification create \
--linkSpecificationId $link_spec_id \
--body '{
"name": "Create my link custom action spec",
"type": "custom",
"parameters": { // defines the input requirements for the action.
"schema": {
"type": "object",
"properties": {
"my_string_property": {
"type": "string"
},
"my_number_property": {
"type": "number",
"default": 0
}
},
"required": [
"my_string_property"
]
},
"values": {}
},
"results": { // defines the expected output of the action.
"schema": {
"type": "object",
"properties": {
"my_string_property": {
"type": "string"
},
"my_number_property": {
"type": "number",
"default": 0
}
},
"required": [
"my_string_property"
]
},
"values": {}
},
"service_specification_id": "134544a6-a089-43ba-9d52-5b6e6e4fa8d1", // the associated service specification
"link_specification_id": "f3e8be90-0952-4506-bd54-c4e75a5a4393" // the associated link specification
}'
curl -X POST "https://api.nullplatform.com/link_specification/$link_spec_id/action_specification" \
-H "Content-Type: application/json" \
-d '{
"name": "Create my service custom action",
"type": "custom",
"parameters": { // defines the input requirements for the action.
"schema": {
"type": "object",
"properties": {
"my_string_property": {
"type": "string"
},
"my_number_property": {
"type": "number",
"default": 0
}
},
"required": [
"my_string_property"
]
},
"values": {}
},
"results": { // defines the expected output of the action.
"schema": {
"type": "object",
"properties": {
"my_string_property": {
"type": "string"
},
"my_number_property": {
"type": "number",
"default": 0
}
},
"required": [
"my_string_property"
]
},
"values": {}
},
"service_specification_id": "134544a6-a089-43ba-9d52-5b6e6e4fa8d1", // the associated service specification
"link_specification_id": "f3e8be90-0952-4506-bd54-c4e75a5a4393" // the associated link specification
}'