Chilkat Online Tools

Powershell / EPC 2.0 - Partner Sandbox - 19.4 November [External] / [Lender] Revoke Lender Authentication Token

Back to Collection Items

Add-Type -Path "C:\chilkat\ChilkatDotNet47-9.5.0-x64\ChilkatDotNet47.dll"

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

$http = New-Object Chilkat.Http

$http.BasicAuth = $true
$http.Login = "username"
$http.Password = "password"

$req = New-Object Chilkat.HttpRequest

$jsonParam1 = New-Object Chilkat.JsonObject
$req.AddParam("token",$jsonParam1.Emit())

$resp = $http.PostUrlEncoded("https://domain.com/",$req)
if ($http.LastMethodSuccess -eq $false) {
    $($http.LastErrorText)
    exit
}

$($resp.StatusCode)
$($resp.BodyStr)

Curl Command

curl -X POST
	-u 'username:password'
	-H "Content-Type: application/x-www-form-urlencoded"
	--data-urlencode 'token={{lender_token}}'
https://domain.com/

Postman Collection Item JSON

{
  "name": "[Lender] Revoke Lender Authentication Token",
  "event": [
    {
      "listen": "test",
      "script": {
        "id": "7252b9c5-c9f3-49bc-a6a9-30e20a9cde88",
        "exec": [
          ""
        ],
        "type": "text/javascript"
      }
    }
  ],
  "_postman_id": "e79391db-32a5-440c-bf2b-e68b0031293c",
  "request": {
    "auth": {
      "type": "basic",
      "basic": {
        "username": "{{lender_client_id}}",
        "password": "{{lender_client_secret}}",
        "showPassword": false
      }
    },
    "method": "POST",
    "header": [
      {
        "key": "Content-Type",
        "name": "Content-Type",
        "type": "text",
        "value": "application/x-www-form-urlencoded",
        "disabled": true
      }
    ],
    "body": {
      "mode": "urlencoded",
      "urlencoded": [
        {
          "key": "token",
          "value": "{{lender_token}}",
          "type": "text"
        }
      ]
    },
    "url": "{{api_host}}/oauth2/v1/token/revocation"
  },
  "response": [
  ]
}