Back to Collection Items
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
' This example assumes the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.
set http = Server.CreateObject("Chilkat.Http")
set queryParams = Server.CreateObject("Chilkat.JsonObject")
success = queryParams.UpdateString("q","Select Id, Name from Pricebook2 Where name='Standard Price Book' and IsActive = true")
' Adds the "Authorization: Bearer <access_token>" header.
http.AuthToken = "<access_token>"
set resp = Server.CreateObject("Chilkat.HttpResponse")
success = http.HttpParams("GET","https://domain.com/services/data/v{{version}}/query",queryParams,resp)
If (success = 0) Then
Response.Write "<pre>" & Server.HTMLEncode( http.LastErrorText) & "</pre>"
Response.End
End If
Response.Write "<pre>" & Server.HTMLEncode( resp.StatusCode) & "</pre>"
Response.Write "<pre>" & Server.HTMLEncode( resp.BodyStr) & "</pre>"
%>
</body>
</html>
Curl Command
curl -G -d "q=Select%20Id,%20Name%20from%20Pricebook2%20Where%20name%3D%27Standard%20Price%20Book%27%20and%20IsActive%20%3D%20true"
-H "Authorization: Bearer <access_token>"
https://domain.com/services/data/v{{version}}/query
Postman Collection Item JSON
{
"name": "Get Standard Pricebook",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const context = pm.environment.name ? pm.environment : pm.collectionVariables;",
"const jsonData = JSON.parse(responseBody);",
"",
"context.set(\"standardPricebook\", jsonData.records[0].Id);"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{_endpoint}}/services/data/v{{version}}/query?q=Select Id, Name from Pricebook2 Where name='Standard Price Book' and IsActive = true",
"host": [
"{{_endpoint}}"
],
"path": [
"services",
"data",
"v{{version}}",
"query"
],
"query": [
{
"key": "q",
"value": "Select Id, Name from Pricebook2 Where name='Standard Price Book' and IsActive = true"
}
]
}
},
"response": [
]
}