SQL Server / Plivo REST API / Retrieve a PHLO Run
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_OASetProperty @http, 'BasicAuth', 1
EXEC sp_OASetProperty @http, 'Login', '{{auth_id}}'
EXEC sp_OASetProperty @http, 'Password', 'password'
DECLARE @sbResponseBody int
-- Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
EXEC @hr = sp_OACreate 'Chilkat.StringBuilder', @sbResponseBody OUT
EXEC sp_OAMethod @http, 'QuickGetSb', @success OUT, 'https://phlorunner.plivo.com/v1/phlo/{phlo_id}/runs/{run_id}', @sbResponseBody
IF @success = 0
BEGIN
EXEC sp_OAGetProperty @http, 'LastErrorText', @sTmp0 OUT
PRINT @sTmp0
EXEC @hr = sp_OADestroy @http
EXEC @hr = sp_OADestroy @sbResponseBody
RETURN
END
EXEC sp_OAGetProperty @http, 'LastStatus', @iTmp0 OUT
PRINT 'Response status code = ' + @iTmp0
EXEC sp_OAMethod @sbResponseBody, 'GetAsString', @sTmp0 OUT
PRINT @sTmp0
EXEC @hr = sp_OADestroy @http
EXEC @hr = sp_OADestroy @sbResponseBody
END
GO
Curl Command
curl -X GET
-u '{{auth_id}}:password'
https://phlorunner.plivo.com/v1/phlo/{phlo_id}/runs/{run_id}
Postman Collection Item JSON
{
"name": "Retrieve a PHLO Run",
"request": {
"method": "GET",
"header": [
],
"url": {
"raw": "https://phlorunner.plivo.com/v1/phlo/{phlo_id}/runs/{run_id}",
"protocol": "https",
"host": [
"phlorunner",
"plivo",
"com"
],
"path": [
"v1",
"phlo",
"{phlo_id}",
"runs",
"{run_id}"
]
},
"description": "More infomration can be found [here](https://www.plivo.com/docs/phlo/api/phlo#retrieve-a-phlo-run)"
},
"response": [
{
"name": "Retrieve a PHLO Run",
"originalRequest": {
"method": "GET",
"header": [
],
"url": {
"raw": "https://phlorunner.plivo.com/v1/phlo/{phlo_id}/runs/{run_id}",
"protocol": "https",
"host": [
"phlorunner",
"plivo",
"com"
],
"path": [
"v1",
"phlo",
"{phlo_id}",
"runs",
"{run_id}"
]
}
},
"code": 200,
"_postman_previewlanguage": "json",
"header": [
],
"cookie": [
],
"body": "{\n \"api_id\": \"36989807-a76f-4555-84d1-9dfdccca7a80\",\n \"phlo_id\": \"e564a84a-7910-4447-b16f-65c541dd552c\",\n \"run_id\": \"b7df01fd-1cb0-404e-a0d1-21e69a610e84\",\n \"call_uuids\": [\n \"11e4f82c-069c-49f9-9fcb-54c6633e2cdb\"\n ],\n \"message_uuids\": [],\n \"recording_ids\": []\n}"
}
]
}