Back to Collection Items
integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_SbResponseBody
oleobject loo_JResp
integer li_RespStatusCode
string ls_Tooling
string ls_Metadata
string ls_Eclair
string ls_Folders
string ls_PrechatForms
string ls_Contact_tracing
string ls_Jsonxform
string ls_Chatter
string ls_Payments
string ls_Tabs
string ls_AppMenu
string ls_QuickActions
string ls_QueryAll
string ls_Commerce
string ls_Wave
string ls_Iot
string ls_Analytics
string ls_Search
string ls_Smartdatadiscovery
string ls_Identity
string ls_Composite
string ls_ParameterizedSearch
string ls_Fingerprint
string ls_Theme
string ls_Nouns
string ls_Domino
string ls_V_event
string ls_ServiceTemplates
string ls_Recent
string ls_Connect
string ls_Licensing
string ls_Limits
string ls_Process
string ls_Dedupe
string ls_Async_queries
string ls_Query
string ls_Jobs
string ls_Match
string ls_Localizedvalue
string ls_Mobile
string ls_EmailConnect
string ls_Consent
string ls_Tokenizer
string ls_CompactLayouts
string ls_KnowledgeManagement
string ls_Sobjects
string ls_Actions
string ls_Support
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
loo_Http = create oleobject
// Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
destroy loo_Http
MessageBox("Error","Connecting to COM object failed")
return
end if
// Adds the "Authorization: Bearer <access_token>" header.
loo_Http.AuthToken = "<access_token>"
loo_Http.SetRequestHeader("Content-Type","application/json")
loo_SbResponseBody = create oleobject
// Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
li_rc = loo_SbResponseBody.ConnectToNewObject("Chilkat.StringBuilder")
li_Success = loo_Http.QuickGetSb("https://domain.com/services/data/v{{version}}/",loo_SbResponseBody)
if li_Success = 0 then
Write-Debug loo_Http.LastErrorText
destroy loo_Http
destroy loo_SbResponseBody
return
end if
loo_JResp = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_JResp.ConnectToNewObject("Chilkat.JsonObject")
loo_JResp.LoadSb(loo_SbResponseBody)
loo_JResp.EmitCompact = 0
Write-Debug "Response Body:"
Write-Debug loo_JResp.Emit()
li_RespStatusCode = loo_Http.LastStatus
Write-Debug "Response Status Code = " + string(li_RespStatusCode)
if li_RespStatusCode >= 400 then
Write-Debug "Response Header:"
Write-Debug loo_Http.LastHeader
Write-Debug "Failed."
destroy loo_Http
destroy loo_SbResponseBody
destroy loo_JResp
return
end if
// Sample JSON response:
// (Sample code for parsing the JSON response is shown below)
// {
// "tooling": "/services/data/v58.0/tooling",
// "metadata": "/services/data/v58.0/metadata",
// "eclair": "/services/data/v58.0/eclair",
// "folders": "/services/data/v58.0/folders",
// "prechatForms": "/services/data/v58.0/prechatForms",
// "contact-tracing": "/services/data/v58.0/contact-tracing",
// "jsonxform": "/services/data/v58.0/jsonxform",
// "chatter": "/services/data/v58.0/chatter",
// "payments": "/services/data/v58.0/payments",
// "tabs": "/services/data/v58.0/tabs",
// "appMenu": "/services/data/v58.0/appMenu",
// "quickActions": "/services/data/v58.0/quickActions",
// "queryAll": "/services/data/v58.0/queryAll",
// "commerce": "/services/data/v58.0/commerce",
// "wave": "/services/data/v58.0/wave",
// "iot": "/services/data/v58.0/iot",
// "analytics": "/services/data/v58.0/analytics",
// "search": "/services/data/v58.0/search",
// "smartdatadiscovery": "/services/data/v58.0/smartdatadiscovery",
// "identity": "https://login.salesforce.com/id/00DB0000000DFgjMAG/005B0000003TOI6IAO",
// "composite": "/services/data/v58.0/composite",
// "parameterizedSearch": "/services/data/v58.0/parameterizedSearch",
// "fingerprint": "/services/data/v58.0/fingerprint",
// "theme": "/services/data/v58.0/theme",
// "nouns": "/services/data/v58.0/nouns",
// "domino": "/services/data/v58.0/domino",
// "event": "/services/data/v58.0/event",
// "serviceTemplates": "/services/data/v58.0/serviceTemplates",
// "recent": "/services/data/v58.0/recent",
// "connect": "/services/data/v58.0/connect",
// "licensing": "/services/data/v58.0/licensing",
// "limits": "/services/data/v58.0/limits",
// "process": "/services/data/v58.0/process",
// "dedupe": "/services/data/v58.0/dedupe",
// "async-queries": "/services/data/v58.0/async-queries",
// "query": "/services/data/v58.0/query",
// "jobs": "/services/data/v58.0/jobs",
// "match": "/services/data/v58.0/match",
// "localizedvalue": "/services/data/v58.0/localizedvalue",
// "mobile": "/services/data/v58.0/mobile",
// "emailConnect": "/services/data/v58.0/emailConnect",
// "consent": "/services/data/v58.0/consent",
// "tokenizer": "/services/data/v58.0/tokenizer",
// "compactLayouts": "/services/data/v58.0/compactLayouts",
// "knowledgeManagement": "/services/data/v58.0/knowledgeManagement",
// "sobjects": "/services/data/v58.0/sobjects",
// "actions": "/services/data/v58.0/actions",
// "support": "/services/data/v58.0/support"
// }
// Sample code for parsing the JSON response...
// Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code
ls_Tooling = loo_JResp.StringOf("tooling")
ls_Metadata = loo_JResp.StringOf("metadata")
ls_Eclair = loo_JResp.StringOf("eclair")
ls_Folders = loo_JResp.StringOf("folders")
ls_PrechatForms = loo_JResp.StringOf("prechatForms")
ls_Contact_tracing = loo_JResp.StringOf("contact-tracing")
ls_Jsonxform = loo_JResp.StringOf("jsonxform")
ls_Chatter = loo_JResp.StringOf("chatter")
ls_Payments = loo_JResp.StringOf("payments")
ls_Tabs = loo_JResp.StringOf("tabs")
ls_AppMenu = loo_JResp.StringOf("appMenu")
ls_QuickActions = loo_JResp.StringOf("quickActions")
ls_QueryAll = loo_JResp.StringOf("queryAll")
ls_Commerce = loo_JResp.StringOf("commerce")
ls_Wave = loo_JResp.StringOf("wave")
ls_Iot = loo_JResp.StringOf("iot")
ls_Analytics = loo_JResp.StringOf("analytics")
ls_Search = loo_JResp.StringOf("search")
ls_Smartdatadiscovery = loo_JResp.StringOf("smartdatadiscovery")
ls_Identity = loo_JResp.StringOf("identity")
ls_Composite = loo_JResp.StringOf("composite")
ls_ParameterizedSearch = loo_JResp.StringOf("parameterizedSearch")
ls_Fingerprint = loo_JResp.StringOf("fingerprint")
ls_Theme = loo_JResp.StringOf("theme")
ls_Nouns = loo_JResp.StringOf("nouns")
ls_Domino = loo_JResp.StringOf("domino")
ls_V_event = loo_JResp.StringOf("event")
ls_ServiceTemplates = loo_JResp.StringOf("serviceTemplates")
ls_Recent = loo_JResp.StringOf("recent")
ls_Connect = loo_JResp.StringOf("connect")
ls_Licensing = loo_JResp.StringOf("licensing")
ls_Limits = loo_JResp.StringOf("limits")
ls_Process = loo_JResp.StringOf("process")
ls_Dedupe = loo_JResp.StringOf("dedupe")
ls_Async_queries = loo_JResp.StringOf("async-queries")
ls_Query = loo_JResp.StringOf("query")
ls_Jobs = loo_JResp.StringOf("jobs")
ls_Match = loo_JResp.StringOf("match")
ls_Localizedvalue = loo_JResp.StringOf("localizedvalue")
ls_Mobile = loo_JResp.StringOf("mobile")
ls_EmailConnect = loo_JResp.StringOf("emailConnect")
ls_Consent = loo_JResp.StringOf("consent")
ls_Tokenizer = loo_JResp.StringOf("tokenizer")
ls_CompactLayouts = loo_JResp.StringOf("compactLayouts")
ls_KnowledgeManagement = loo_JResp.StringOf("knowledgeManagement")
ls_Sobjects = loo_JResp.StringOf("sobjects")
ls_Actions = loo_JResp.StringOf("actions")
ls_Support = loo_JResp.StringOf("support")
destroy loo_Http
destroy loo_SbResponseBody
destroy loo_JResp
Curl Command
curl -X GET
-H "Authorization: Bearer <access_token>"
-H "Content-Type: application/json"
https://domain.com/services/data/v{{version}}/
Postman Collection Item JSON
{
"name": "Resources by Version",
"event": [
{
"listen": "prerequest",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{_endpoint}}/services/data/v{{version}}/",
"host": [
"{{_endpoint}}"
],
"path": [
"services",
"data",
"v{{version}}",
""
]
},
"description": "Lists available resources for the specified API version, including resource name and URI."
},
"response": [
{
"name": "Resources by Version",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{_endpoint}}/services/data/v{{version}}/",
"host": [
"{{_endpoint}}"
],
"path": [
"services",
"data",
"v{{version}}",
""
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Date",
"value": "Tue, 26 Sep 2023 13:29:43 GMT"
},
{
"key": "Strict-Transport-Security",
"value": "max-age=63072000; includeSubDomains"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "X-XSS-Protection",
"value": "1; mode=block"
},
{
"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=3/15000"
},
{
"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 \"tooling\": \"/services/data/v58.0/tooling\",\n \"metadata\": \"/services/data/v58.0/metadata\",\n \"eclair\": \"/services/data/v58.0/eclair\",\n \"folders\": \"/services/data/v58.0/folders\",\n \"prechatForms\": \"/services/data/v58.0/prechatForms\",\n \"contact-tracing\": \"/services/data/v58.0/contact-tracing\",\n \"jsonxform\": \"/services/data/v58.0/jsonxform\",\n \"chatter\": \"/services/data/v58.0/chatter\",\n \"payments\": \"/services/data/v58.0/payments\",\n \"tabs\": \"/services/data/v58.0/tabs\",\n \"appMenu\": \"/services/data/v58.0/appMenu\",\n \"quickActions\": \"/services/data/v58.0/quickActions\",\n \"queryAll\": \"/services/data/v58.0/queryAll\",\n \"commerce\": \"/services/data/v58.0/commerce\",\n \"wave\": \"/services/data/v58.0/wave\",\n \"iot\": \"/services/data/v58.0/iot\",\n \"analytics\": \"/services/data/v58.0/analytics\",\n \"search\": \"/services/data/v58.0/search\",\n \"smartdatadiscovery\": \"/services/data/v58.0/smartdatadiscovery\",\n \"identity\": \"https://login.salesforce.com/id/00DB0000000DFgjMAG/005B0000003TOI6IAO\",\n \"composite\": \"/services/data/v58.0/composite\",\n \"parameterizedSearch\": \"/services/data/v58.0/parameterizedSearch\",\n \"fingerprint\": \"/services/data/v58.0/fingerprint\",\n \"theme\": \"/services/data/v58.0/theme\",\n \"nouns\": \"/services/data/v58.0/nouns\",\n \"domino\": \"/services/data/v58.0/domino\",\n \"event\": \"/services/data/v58.0/event\",\n \"serviceTemplates\": \"/services/data/v58.0/serviceTemplates\",\n \"recent\": \"/services/data/v58.0/recent\",\n \"connect\": \"/services/data/v58.0/connect\",\n \"licensing\": \"/services/data/v58.0/licensing\",\n \"limits\": \"/services/data/v58.0/limits\",\n \"process\": \"/services/data/v58.0/process\",\n \"dedupe\": \"/services/data/v58.0/dedupe\",\n \"async-queries\": \"/services/data/v58.0/async-queries\",\n \"query\": \"/services/data/v58.0/query\",\n \"jobs\": \"/services/data/v58.0/jobs\",\n \"match\": \"/services/data/v58.0/match\",\n \"localizedvalue\": \"/services/data/v58.0/localizedvalue\",\n \"mobile\": \"/services/data/v58.0/mobile\",\n \"emailConnect\": \"/services/data/v58.0/emailConnect\",\n \"consent\": \"/services/data/v58.0/consent\",\n \"tokenizer\": \"/services/data/v58.0/tokenizer\",\n \"compactLayouts\": \"/services/data/v58.0/compactLayouts\",\n \"knowledgeManagement\": \"/services/data/v58.0/knowledgeManagement\",\n \"sobjects\": \"/services/data/v58.0/sobjects\",\n \"actions\": \"/services/data/v58.0/actions\",\n \"support\": \"/services/data/v58.0/support\"\n}"
}
]
}