Back to Collection Items
integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_QueryParams
oleobject loo_Resp
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
loo_Http = create oleobject
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
loo_QueryParams = create oleobject
li_rc = loo_QueryParams.ConnectToNewObject("Chilkat.JsonObject")
loo_QueryParams.UpdateString("include","tabs")
// Adds the "Authorization: Bearer <access_token>" header.
loo_Http.AuthToken = "<access_token>"
loo_Resp = create oleobject
li_rc = loo_Resp.ConnectToNewObject("Chilkat.HttpResponse")
li_Success = loo_Http.HttpParams("GET","https://domain.com/{{apiVersion}}/accounts/{{accountId}}/templates/{{templateId}}",loo_QueryParams,loo_Resp)
if li_Success = 0 then
Write-Debug loo_Http.LastErrorText
destroy loo_Http
destroy loo_QueryParams
destroy loo_Resp
return
end if
Write-Debug string(loo_Resp.StatusCode)
Write-Debug loo_Resp.BodyStr
destroy loo_Http
destroy loo_QueryParams
destroy loo_Resp
Curl Command
curl -G -d "include=tabs"
-H "Authorization: Bearer <access_token>"
https://domain.com/{{apiVersion}}/accounts/{{accountId}}/templates/{{templateId}}
Postman Collection Item JSON
{
"name": "17. Get Template Definition",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{accessToken}}",
"type": "string"
}
]
},
"method": "GET",
"header": [
],
"url": {
"raw": "{{baseUrl}}/{{apiVersion}}/accounts/{{accountId}}/templates/{{templateId}}?include=tabs",
"host": [
"{{baseUrl}}"
],
"path": [
"{{apiVersion}}",
"accounts",
"{{accountId}}",
"templates",
"{{templateId}}"
],
"query": [
{
"key": "include",
"value": "tabs"
}
]
},
"description": "If one is not sure which template is the one they want to use, they can fetch the template after listing it and verify that it's the one they want to use."
},
"response": [
]
}