Back to Collection Items
Use ChilkatAx-win32.pkg
Procedure Test
Handle hoHttp
Boolean iSuccess
Variant vSbResponseBody
Handle hoSbResponseBody
Handle hoJResp
Integer iRespStatusCode
String sV_Type
String sV_Url
String sId
Boolean iIsDeleted
String sDeveloperName
String sLanguage
String sMasterLabel
String sNamespacePrefix
String sManageableState
String sCreatedDate
String sCreatedById
String sLastModifiedDate
String sLastModifiedById
String sSystemModstamp
String sFullName
String sEventChannel
String sFilterExpression
String sSelectedEntity
String sUrls
Integer i
Integer iCount_i
String sTemp1
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Get Create (RefClass(cComChilkatHttp)) To hoHttp
If (Not(IsComObjectCreated(hoHttp))) Begin
Send CreateComObject of hoHttp
End
// Adds the "Authorization: Bearer <access_token>" header.
Set ComAuthToken Of hoHttp To "<access_token>"
Get Create (RefClass(cComChilkatStringBuilder)) To hoSbResponseBody
If (Not(IsComObjectCreated(hoSbResponseBody))) Begin
Send CreateComObject of hoSbResponseBody
End
Get pvComObject of hoSbResponseBody to vSbResponseBody
Get ComQuickGetSb Of hoHttp "https://domain.com/services/data/v{{version}}/tooling/sobjects/PlatformEventChannelMember/:PLATFORM_EVENT_CHANNEL_MEMBER_ID" vSbResponseBody To iSuccess
If (iSuccess = False) Begin
Get ComLastErrorText Of hoHttp To sTemp1
Showln sTemp1
Procedure_Return
End
Get Create (RefClass(cComChilkatJsonObject)) To hoJResp
If (Not(IsComObjectCreated(hoJResp))) Begin
Send CreateComObject of hoJResp
End
Get pvComObject of hoSbResponseBody to vSbResponseBody
Get ComLoadSb Of hoJResp vSbResponseBody To iSuccess
Set ComEmitCompact Of hoJResp To False
Showln "Response Body:"
Get ComEmit Of hoJResp To sTemp1
Showln sTemp1
Get ComLastStatus Of hoHttp To iRespStatusCode
Showln "Response Status Code = " iRespStatusCode
If (iRespStatusCode >= 400) Begin
Showln "Response Header:"
Get ComLastHeader Of hoHttp To sTemp1
Showln sTemp1
Showln "Failed."
Procedure_Return
End
// Sample JSON response:
// (Sample code for parsing the JSON response is shown below)
// {
// "attributes": {
// "type": "PlatformEventChannelMember",
// "url": "/services/data/v58.0/tooling/sobjects/PlatformEventChannelMember/0v84H000000PAvIQAW"
// },
// "Id": "0v84H000000PAvIQAW",
// "IsDeleted": false,
// "DeveloperName": "ChangeEvents_ContactChangeEvent",
// "Language": "en_US",
// "MasterLabel": "ContactChangeEvent",
// "NamespacePrefix": null,
// "ManageableState": "unmanaged",
// "CreatedDate": "2022-12-30T15:10:39.000+0000",
// "CreatedById": "00558000000yFyDAAU",
// "LastModifiedDate": "2022-12-30T15:10:39.000+0000",
// "LastModifiedById": "00558000000yFyDAAU",
// "SystemModstamp": "2022-12-30T15:10:39.000+0000",
// "FullName": "ChangeEvents_ContactChangeEvent",
// "Metadata": {
// "enrichedFields": [
// ],
// "eventChannel": "ChangeEvents",
// "filterExpression": null,
// "selectedEntity": "ContactChangeEvent",
// "urls": null
// },
// "EventChannel": "ChangeEvents",
// "SelectedEntity": "ContactChangeEvent",
// "FilterExpression": null
// }
// Sample code for parsing the JSON response...
// Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code
Get ComStringOf Of hoJResp "attributes.type" To sV_Type
Get ComStringOf Of hoJResp "attributes.url" To sV_Url
Get ComStringOf Of hoJResp "Id" To sId
Get ComBoolOf Of hoJResp "IsDeleted" To iIsDeleted
Get ComStringOf Of hoJResp "DeveloperName" To sDeveloperName
Get ComStringOf Of hoJResp "Language" To sLanguage
Get ComStringOf Of hoJResp "MasterLabel" To sMasterLabel
Get ComStringOf Of hoJResp "NamespacePrefix" To sNamespacePrefix
Get ComStringOf Of hoJResp "ManageableState" To sManageableState
Get ComStringOf Of hoJResp "CreatedDate" To sCreatedDate
Get ComStringOf Of hoJResp "CreatedById" To sCreatedById
Get ComStringOf Of hoJResp "LastModifiedDate" To sLastModifiedDate
Get ComStringOf Of hoJResp "LastModifiedById" To sLastModifiedById
Get ComStringOf Of hoJResp "SystemModstamp" To sSystemModstamp
Get ComStringOf Of hoJResp "FullName" To sFullName
Get ComStringOf Of hoJResp "Metadata.eventChannel" To sEventChannel
Get ComStringOf Of hoJResp "Metadata.filterExpression" To sFilterExpression
Get ComStringOf Of hoJResp "Metadata.selectedEntity" To sSelectedEntity
Get ComStringOf Of hoJResp "Metadata.urls" To sUrls
Get ComStringOf Of hoJResp "EventChannel" To sEventChannel
Get ComStringOf Of hoJResp "SelectedEntity" To sSelectedEntity
Get ComStringOf Of hoJResp "FilterExpression" To sFilterExpression
Move 0 To i
Get ComSizeOfArray Of hoJResp "Metadata.enrichedFields" To iCount_i
While (i < iCount_i)
Set ComI Of hoJResp To i
Move (i + 1) To i
Loop
End_Procedure
Curl Command
curl -X GET
-H "Authorization: Bearer <access_token>"
https://domain.com/services/data/v{{version}}/tooling/sobjects/PlatformEventChannelMember/:PLATFORM_EVENT_CHANNEL_MEMBER_ID
Postman Collection Item JSON
{
"name": "Get channel member",
"protocolProfileBehavior": {
"strictSSL": false,
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{_endpoint}}/services/data/v{{version}}/tooling/sobjects/PlatformEventChannelMember/:PLATFORM_EVENT_CHANNEL_MEMBER_ID",
"host": [
"{{_endpoint}}"
],
"path": [
"services",
"data",
"v{{version}}",
"tooling",
"sobjects",
"PlatformEventChannelMember",
":PLATFORM_EVENT_CHANNEL_MEMBER_ID"
],
"variable": [
{
"key": "PLATFORM_EVENT_CHANNEL_MEMBER_ID",
"value": ""
}
]
}
},
"response": [
{
"name": "Get channel member",
"originalRequest": {
"method": "GET",
"header": [
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{_endpoint}}/services/data/v{{version}}/tooling/sobjects/PlatformEventChannelMember/:PLATFORM_EVENT_CHANNEL_MEMBER_ID",
"host": [
"{{_endpoint}}"
],
"path": [
"services",
"data",
"v{{version}}",
"tooling",
"sobjects",
"PlatformEventChannelMember",
":PLATFORM_EVENT_CHANNEL_MEMBER_ID"
],
"variable": [
{
"key": "PLATFORM_EVENT_CHANNEL_MEMBER_ID",
"value": "0v84H000000PAvIQAW"
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Date",
"value": "Mon, 03 Jul 2023 13:17:20 GMT"
},
{
"key": "Strict-Transport-Security",
"value": "max-age=63072000; includeSubDomains"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "X-Robots-Tag",
"value": "none"
},
{
"key": "Cache-Control",
"value": "no-cache,must-revalidate,max-age=0,no-store,private"
},
{
"key": "Sforce-Limit-Info",
"value": "api-usage=9/15000"
},
{
"key": "Last-Modified",
"value": "Fri, 30 Dec 2022 15:10:39 GMT"
},
{
"key": "Content-Type",
"value": "application/json;charset=UTF-8"
},
{
"key": "Vary",
"value": "Accept-Encoding"
},
{
"key": "Content-Encoding",
"value": "gzip"
},
{
"key": "Transfer-Encoding",
"value": "chunked"
}
],
"cookie": [
],
"body": "{\n \"attributes\": {\n \"type\": \"PlatformEventChannelMember\",\n \"url\": \"/services/data/v58.0/tooling/sobjects/PlatformEventChannelMember/0v84H000000PAvIQAW\"\n },\n \"Id\": \"0v84H000000PAvIQAW\",\n \"IsDeleted\": false,\n \"DeveloperName\": \"ChangeEvents_ContactChangeEvent\",\n \"Language\": \"en_US\",\n \"MasterLabel\": \"ContactChangeEvent\",\n \"NamespacePrefix\": null,\n \"ManageableState\": \"unmanaged\",\n \"CreatedDate\": \"2022-12-30T15:10:39.000+0000\",\n \"CreatedById\": \"00558000000yFyDAAU\",\n \"LastModifiedDate\": \"2022-12-30T15:10:39.000+0000\",\n \"LastModifiedById\": \"00558000000yFyDAAU\",\n \"SystemModstamp\": \"2022-12-30T15:10:39.000+0000\",\n \"FullName\": \"ChangeEvents_ContactChangeEvent\",\n \"Metadata\": {\n \"enrichedFields\": [],\n \"eventChannel\": \"ChangeEvents\",\n \"filterExpression\": null,\n \"selectedEntity\": \"ContactChangeEvent\",\n \"urls\": null\n },\n \"EventChannel\": \"ChangeEvents\",\n \"SelectedEntity\": \"ContactChangeEvent\",\n \"FilterExpression\": null\n}"
}
]
}