Back to Collection Items
-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls.
--
CREATE PROCEDURE ChilkatSample
AS
BEGIN
DECLARE @hr int
DECLARE @iTmp0 int
-- Important: Do not use nvarchar(max). See the warning about using nvarchar(max).
DECLARE @sTmp0 nvarchar(4000)
-- This example assumes the Chilkat API to have been previously unlocked.
-- See Global Unlock Sample for sample code.
DECLARE @http int
-- Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
EXEC @hr = sp_OACreate 'Chilkat.Http', @http OUT
IF @hr <> 0
BEGIN
PRINT 'Failed to create ActiveX component'
RETURN
END
DECLARE @success int
EXEC sp_OAMethod @http, 'SetRequestHeader', NULL, 'Authorization', ''
DECLARE @resp int
EXEC sp_OAMethod @http, 'QuickRequest', @resp OUT, 'DELETE', 'https://api.squadcast.com/v3/services/:serviceID'
EXEC sp_OAGetProperty @http, 'LastMethodSuccess', @iTmp0 OUT
IF @iTmp0 = 0
BEGIN
EXEC sp_OAGetProperty @http, 'LastErrorText', @sTmp0 OUT
PRINT @sTmp0
EXEC @hr = sp_OADestroy @http
RETURN
END
DECLARE @respStatusCode int
EXEC sp_OAGetProperty @resp, 'StatusCode', @respStatusCode OUT
PRINT 'Response Status Code = ' + @respStatusCode
IF @respStatusCode <> 204
BEGIN
PRINT 'Response Header:'
EXEC sp_OAGetProperty @resp, 'Header', @sTmp0 OUT
PRINT @sTmp0
PRINT 'Response Body:'
EXEC sp_OAGetProperty @resp, 'BodyStr', @sTmp0 OUT
PRINT @sTmp0
PRINT 'Failed.'
EXEC @hr = sp_OADestroy @resp
EXEC @hr = sp_OADestroy @http
RETURN
END
EXEC @hr = sp_OADestroy @resp
PRINT 'Success.'
EXEC @hr = sp_OADestroy @http
END
GO
Curl Command
curl -X DELETE
-H "Authorization: "
https://api.squadcast.com/v3/services/:serviceID
Postman Collection Item JSON
{
"name": "Delete Service",
"request": {
"auth": {
"type": "noauth"
},
"method": "DELETE",
"header": [
{
"key": "Authorization",
"value": ""
}
],
"url": {
"raw": "{{baseUrl}}/services/:serviceID",
"host": [
"{{baseUrl}}"
],
"path": [
"services",
":serviceID"
],
"variable": [
{
"key": "serviceID",
"value": "<string>",
"type": "string",
"description": "(Required) service id"
}
]
},
"description": "It will soft delete the service.\nThe service should not have any open incidents, in order to delete the service you have to acknowledge or resolve all the open incident for this service.\n\nRequires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `service-write` scope."
},
"response": [
{
"name": "Bad Request",
"originalRequest": {
"method": "DELETE",
"header": [
],
"url": {
"raw": "{{baseUrl}}/services/:serviceID",
"host": [
"{{baseUrl}}"
],
"path": [
"services",
":serviceID"
],
"variable": [
{
"key": "serviceID"
}
]
}
},
"status": "Bad Request",
"code": 400,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"meta\": {\n \"status\": \"<integer>\",\n \"error_message\": \"<string>\"\n }\n}"
},
{
"name": "Not Found",
"originalRequest": {
"method": "DELETE",
"header": [
],
"url": {
"raw": "{{baseUrl}}/services/:serviceID",
"host": [
"{{baseUrl}}"
],
"path": [
"services",
":serviceID"
],
"variable": [
{
"key": "serviceID"
}
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"meta\": {\n \"status\": \"<integer>\",\n \"error_message\": \"<string>\"\n }\n}"
},
{
"name": "Internal Server Error",
"originalRequest": {
"method": "DELETE",
"header": [
],
"url": {
"raw": "{{baseUrl}}/services/:serviceID",
"host": [
"{{baseUrl}}"
],
"path": [
"services",
":serviceID"
],
"variable": [
{
"key": "serviceID"
}
]
}
},
"status": "Internal Server Error",
"code": 500,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"meta\": {\n \"status\": \"<integer>\",\n \"error_message\": \"<string>\"\n }\n}"
},
{
"name": "Forbidden",
"originalRequest": {
"method": "DELETE",
"header": [
],
"url": {
"raw": "{{baseUrl}}/services/:serviceID",
"host": [
"{{baseUrl}}"
],
"path": [
"services",
":serviceID"
],
"variable": [
{
"key": "serviceID"
}
]
}
},
"status": "Forbidden",
"code": 403,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"meta\": {\n \"status\": \"<integer>\",\n \"error_message\": \"<string>\"\n }\n}"
},
{
"name": "Unauthorized",
"originalRequest": {
"method": "DELETE",
"header": [
],
"url": {
"raw": "{{baseUrl}}/services/:serviceID",
"host": [
"{{baseUrl}}"
],
"path": [
"services",
":serviceID"
],
"variable": [
{
"key": "serviceID"
}
]
}
},
"status": "Unauthorized",
"code": 401,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"meta\": {\n \"status\": \"<integer>\",\n \"error_message\": \"<string>\"\n }\n}"
},
{
"name": "No Content",
"originalRequest": {
"method": "DELETE",
"header": [
],
"url": {
"raw": "{{baseUrl}}/services/:serviceID",
"host": [
"{{baseUrl}}"
],
"path": [
"services",
":serviceID"
],
"variable": [
{
"key": "serviceID"
}
]
}
},
"status": "No Content",
"code": 204,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
}
]
}