Back to Collection Items
; This example assumes the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.
$oHttp = ObjCreate("Chilkat.Http")
Local $bSuccess
$oHttp.BasicAuth = True
$oHttp.Login = "{{secretId}}"
$oHttp.Password = "{{secretPassword}}"
; Use this online tool to generate code from sample JSON: Generate Code to Create JSON
; The following JSON is sent in the request body.
; {
; "link": "link_id"
; }
$oJson = ObjCreate("Chilkat.JsonObject")
$oJson.UpdateString("link","link_id")
Local $oResp = $oHttp.PostJson3("https://domain.com/investments/portfolios/","application/json",$oJson)
If ($oHttp.LastMethodSuccess = False) Then
ConsoleWrite($oHttp.LastErrorText & @CRLF)
Exit
EndIf
ConsoleWrite($oResp.StatusCode & @CRLF)
ConsoleWrite($oResp.BodyStr & @CRLF)
Curl Command
curl -X POST
-u '{{secretId}}:{{secretPassword}}'
-d '{
"link": "link_id"
}'
https://domain.com/investments/portfolios/
Postman Collection Item JSON
{
"name": "Retrieve",
"request": {
"method": "POST",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n \"link\": \"link_id\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{baseUrl}}/investments/portfolios/",
"host": [
"{{baseUrl}}"
],
"path": [
"investments",
"portfolios",
""
]
}
},
"response": [
]
}