Chilkat Online Tools

Go / Salesforce Platform APIs / Delete External Credential

Back to Collection Items

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

    http := chilkat.NewHttp()
    var success bool

    // Adds the "Authorization: Bearer <access_token>" header.
    http.SetAuthToken("<access_token>")

    resp := http.QuickRequest("DELETE","https://domain.com/services/data/v{{version}}/named-credentials/external-credentials/:DEVELOPER_NAME")
    if http.LastMethodSuccess() == false {
        fmt.Println(http.LastErrorText())
        http.DisposeHttp()
        return
    }

    fmt.Println(resp.StatusCode())
    fmt.Println(resp.BodyStr())
    resp.DisposeHttpResponse()

    http.DisposeHttp()

Curl Command

curl -X DELETE
	-H "Authorization: Bearer <access_token>"
https://domain.com/services/data/v{{version}}/named-credentials/external-credentials/:DEVELOPER_NAME

Postman Collection Item JSON

{
  "name": "Delete External Credential",
  "request": {
    "method": "DELETE",
    "header": [
    ],
    "url": {
      "raw": "{{_endpoint}}/services/data/v{{version}}/named-credentials/external-credentials/:DEVELOPER_NAME",
      "host": [
        "{{_endpoint}}"
      ],
      "path": [
        "services",
        "data",
        "v{{version}}",
        "named-credentials",
        "external-credentials",
        ":DEVELOPER_NAME"
      ],
      "variable": [
        {
          "key": "DEVELOPER_NAME",
          "value": ""
        }
      ]
    },
    "description": "Delete an external credential."
  },
  "response": [
    {
      "name": "Successful Delete External Credential",
      "originalRequest": {
        "method": "DELETE",
        "header": [
        ],
        "url": {
          "raw": "{{_endpoint}}/services/data/v{{version}}/named-credentials/external-credentials/:DEVELOPER_NAME",
          "host": [
            "{{_endpoint}}"
          ],
          "path": [
            "services",
            "data",
            "v{{version}}",
            "named-credentials",
            "external-credentials",
            ":DEVELOPER_NAME"
          ],
          "variable": [
            {
              "key": "DEVELOPER_NAME",
              "value": "Test"
            }
          ]
        }
      },
      "status": "No Content",
      "code": 204,
      "_postman_previewlanguage": "plain",
      "header": [
        {
          "key": "Date",
          "value": "Wed, 22 Nov 2023 12:09:23 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": "Content-Security-Policy",
          "value": "upgrade-insecure-requests"
        },
        {
          "key": "X-Robots-Tag",
          "value": "none"
        },
        {
          "key": "Cache-Control",
          "value": "no-cache,must-revalidate,max-age=0,no-store,private"
        }
      ],
      "cookie": [
      ],
      "body": null
    }
  ]
}