Service routes: update, delete
The Service Verbs update, delete as api.sb routes, with inputs, result, refusals and an example.
Reference for Service, one group of Service routes.
Service.update
Changes the given properties of a Service. Verb page.
PATCH /{namespace}/ services/ {id}Path: id. Body, as JSON: the other inputs. Emits Service.updated.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
id | string | required | The id of the Service. |
name | string | The name of the Product. | |
promise | text | What the Customer can rely on. | |
floor | string | The human floor: none, sign, or practice. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
service | Service | required | The Service. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
curl -X PATCH https: //api.sb/ catalogmend.com/ services/ service_Eq1ssq4AOW \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
-H "Content-Type: application/ json" \
-d '{"floor": "none"}'{
"api": "https: //api.sb/ catalogmend.com",
"service": {
"$id": "https: //api.sb/ catalogmend.com/ services/ service_Eq1ssq4AOW",
"$type": "Service",
"name": "Catalogmend",
"promise": "Every listing error fixed or explained within 48 hours.",
"status": "draft",
"floor": "none"
},
"action": {
"$id": "https: //api.sb/ catalogmend.com/ actions/ act_ZY4jDpkbtc",
"operation": "Service.update",
"status": "done"
},
"links": {
"self": "https: //api.sb/ catalogmend.com/ actions/ act_ZY4jDpkbtc"
}
}Service.delete
Deletes a Service: a soft delete that keeps its history, undone by Thing.restore. Verb page.
DELETE /{namespace}/ services/ {id}Path: id. Emits Service.deleted.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
id | string | required | The id of the Service. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
service | Service | required | The Service. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
curl -X DELETE https: //api.sb/ catalogmend.com/ services/ service_Eq1ssq4AOW \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"{
"api": "https: //api.sb/ catalogmend.com",
"service": {
"$id": "https: //api.sb/ catalogmend.com/ services/ service_Eq1ssq4AOW",
"$type": "Service",
"name": "Catalogmend",
"promise": "Every listing error fixed or explained within 48 hours.",
"status": "draft"
},
"action": {
"$id": "https: //api.sb/ catalogmend.com/ actions/ act_ZY4jDpkbtc",
"operation": "Service.delete",
"status": "done"
},
"links": {
"self": "https: //api.sb/ catalogmend.com/ actions/ act_ZY4jDpkbtc"
}
}