SQL Server / Bond APIs / get card
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, 'Content-Type', 'application/json'
EXEC sp_OAMethod @http, 'SetRequestHeader', NULL, 'Authorization', '{{authorization}}'
EXEC sp_OAMethod @http, 'SetRequestHeader', NULL, 'Identity', '{{identity}}'
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://{{environment}}.bond.tech/api/v0/cards/:card_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
-H "Content-Type: application/json"
-H "Authorization: {{authorization}}"
-H "Identity: {{identity}}"
https://{{environment}}.bond.tech/api/v0/cards/:card_id
Postman Collection Item JSON
{
"name": "get card",
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"type": "text",
"value": "application/json"
},
{
"key": "Authorization",
"type": "text",
"value": "{{authorization}}"
},
{
"key": "Identity",
"type": "text",
"value": "{{identity}}"
}
],
"url": {
"raw": "https://{{environment}}.bond.tech/api/v0/cards/:card_id",
"protocol": "https",
"host": [
"{{environment}}",
"bond",
"tech"
],
"path": [
"api",
"v0",
"cards",
":card_id"
],
"variable": [
{
"key": "card_id",
"value": null
}
]
},
"description": "Add Card financial Core"
},
"response": [
{
"name": "get card",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"type": "text",
"value": "application/json"
},
{
"key": "Authorization",
"type": "text",
"value": "{{authorization}}"
},
{
"key": "Identity",
"type": "text",
"value": "{{identity}}"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://{{environment}}.bond.tech/api/v0/cards/:card_id",
"protocol": "https",
"host": [
"{{environment}}",
"bond",
"tech"
],
"path": [
"api",
"v0",
"cards",
":card_id"
],
"variable": [
{
"key": "card_id",
"value": null
}
]
}
},
"_postman_previewlanguage": "json",
"header": null,
"cookie": [
],
"body": "{\n \"card_id\": \"2742ff6a-7455-4066-8b45-ae12d3acca34\",\n \"last_four\": \"6169\",\n \"status\": \"Inactive\",\n \"card_number\": \"tok_live_283734\",\n \"cvv\": \"tok_live_p923u34\",\n \"expiry_date\": \"tok_live_oeueo932\",\n \"card_account_id\": \"48aef94d-8473-47c8-943f-d3ac1745d8fa\",\n \"pseudoDDANumbers\": [\n {\n \"pseudoDdaNumber\": \"1010101010101010\"\n }\n ]\n}"
}
]
}