Chilkat Online Tools

Swift / Salesforce Platform APIs / Validate Quote API

Back to Collection Items

func chilkatTest() {
    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    let http = CkoHttp()
    var success: Bool

    // Adds the "Authorization: Bearer <access_token>" header.
    http.AuthToken = "<access_token>"
    http.SetRequestHeader("Content-Type", value: "application/json")

    var resp: CkoHttpResponse? = http.QuickRequest("PATCH", url: "https://domain.com/services/apexrest/SBQQ/ServiceRouter?loader=QuoteAPI.QuoteValidator")
    if http.LastMethodSuccess == false {
        print("\(http.LastErrorText)")
        return
    }

    print("\(resp!.StatusCode.intValue)")
    print("\(resp!.BodyStr)")
    resp = nil

}

Curl Command

curl -X PATCH
	-H "Authorization: Bearer <access_token>"
	-H "Content-Type: application/json"
https://domain.com/services/apexrest/SBQQ/ServiceRouter?loader=QuoteAPI.QuoteValidator

Postman Collection Item JSON

{
  "name": "Validate Quote API",
  "request": {
    "method": "PATCH",
    "header": [
      {
        "key": "Content-Type",
        "type": "text",
        "value": "application/json"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "",
      "options": {
        "raw": {
          "language": "json"
        }
      }
    },
    "url": {
      "raw": "{{_endpoint}}/services/apexrest/SBQQ/ServiceRouter?loader=QuoteAPI.QuoteValidator",
      "host": [
        "{{_endpoint}}"
      ],
      "path": [
        "services",
        "apexrest",
        "SBQQ",
        "ServiceRouter"
      ],
      "query": [
        {
          "key": "loader",
          "value": "QuoteAPI.QuoteValidator"
        }
      ]
    },
    "description": "Validate a CPQ quote and return any validation errors.\nAvailable in: Salesforce CPQ Winter ’19 and later\n\nhttps://developer.salesforce.com/docs/atlas.en-us.cpq_dev_api.meta/cpq_dev_api/cpq_api_validate_quote.htm"
  },
  "response": [
  ]
}