Back to Collection Items
import com.chilkatsoft.*;
public class ChilkatExample {
static {
try {
System.loadLibrary("chilkat");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load.\n" + e);
System.exit(1);
}
}
public static void main(String argv[])
{
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
CkHttp http = new CkHttp();
boolean success;
// Adds the "Authorization: Bearer <access_token>" header.
http.put_AuthToken("<access_token>");
http.SetRequestHeader("Content-Type","application/json");
CkHttpResponse resp = http.QuickRequest("POST","https://domain.com/services/apexrest/SBQQ/ServiceRouter");
if (http.get_LastMethodSuccess() == false) {
System.out.println(http.lastErrorText());
return;
}
System.out.println(resp.get_StatusCode());
System.out.println(resp.bodyStr());
}
}
Curl Command
curl -X POST
-H "Authorization: Bearer <access_token>"
-H "Content-Type: application/json"
https://domain.com/services/apexrest/SBQQ/ServiceRouter
Postman Collection Item JSON
{
"name": "Save Quote API",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{_endpoint}}/services/apexrest/SBQQ/ServiceRouter",
"host": [
"{{_endpoint}}"
],
"path": [
"services",
"apexrest",
"SBQQ",
"ServiceRouter"
]
},
"description": "The Save Quote API saves a CPQ quote.\nAvailable in: Salesforce CPQ Summer ’16 and later\n\nhttps://developer.salesforce.com/docs/atlas.en-us.cpq_dev_api.meta/cpq_dev_api/cpq_quote_api_save_final.htm"
},
"response": [
]
}