PowerBuilder / Anypoint Platform APIs / Get all assets for organization by Id
Back to Collection Items
integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_QueryParams
oleobject loo_Resp
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
loo_Http = create oleobject
// Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
destroy loo_Http
MessageBox("Error","Connecting to COM object failed")
return
end if
loo_QueryParams = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_QueryParams.ConnectToNewObject("Chilkat.JsonObject")
loo_QueryParams.UpdateString("search","")
loo_QueryParams.UpdateString("types","api-group")
loo_QueryParams.UpdateString("types","connector")
loo_QueryParams.UpdateString("types","custom")
loo_QueryParams.UpdateString("types","example")
loo_QueryParams.UpdateString("types","extension")
loo_QueryParams.UpdateString("types","http-api")
loo_QueryParams.UpdateString("types","policy")
loo_QueryParams.UpdateString("types","raml-fragment")
loo_QueryParams.UpdateString("types","rest-api")
loo_QueryParams.UpdateString("types","soap-api")
loo_QueryParams.UpdateString("types","template")
loo_QueryParams.UpdateString("domain","")
loo_QueryParams.UpdateString("organizationId","{{organization_id}}")
loo_QueryParams.UpdateString("masterOrganizationId","")
loo_QueryParams.UpdateInt("offset",0)
loo_QueryParams.UpdateInt("limit",20)
loo_QueryParams.UpdateString("sharedWithMe","")
loo_QueryParams.UpdateString("includeSnapshots","true")
// Adds the "Authorization: Bearer {{token}}" header.
loo_Http.AuthToken = "{{token}}"
loo_Resp = loo_Http.QuickRequestParams("GET","https://domain.com/exchange/api/v2/assets",loo_QueryParams)
if loo_Http.LastMethodSuccess = 0 then
Write-Debug loo_Http.LastErrorText
destroy loo_Http
destroy loo_QueryParams
return
end if
Write-Debug string(loo_Resp.StatusCode)
Write-Debug loo_Resp.BodyStr
destroy loo_Resp
destroy loo_Http
destroy loo_QueryParams
Curl Command
curl -G -d "search="
-d "types=api-group"
-d "types=connector"
-d "types=custom"
-d "types=example"
-d "types=extension"
-d "types=http-api"
-d "types=policy"
-d "types=raml-fragment"
-d "types=rest-api"
-d "types=soap-api"
-d "types=template"
-d "domain="
-d "organizationId=%7B%7Borganization_id%7D%7D"
-d "masterOrganizationId="
-d "offset=0"
-d "limit=20"
-d "sharedWithMe="
-d "includeSnapshots=true"
-H "Authorization: Bearer {{token}}"
https://domain.com/exchange/api/v2/assets
Postman Collection Item JSON
{
"name": "Get all assets for organization by Id",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{token}}",
"type": "text"
}
],
"url": {
"raw": "{{url}}/exchange/api/v2/assets?search=&types=api-group&types=connector&types=custom&types=example&types=extension&types=http-api&types=policy&types=raml-fragment&types=rest-api&types=soap-api&types=template&domain=&organizationId={{organization_id}}&masterOrganizationId=&offset=0&limit=20&sharedWithMe=&includeSnapshots=true",
"host": [
"{{url}}"
],
"path": [
"exchange",
"api",
"v2",
"assets"
],
"query": [
{
"key": "search",
"value": ""
},
{
"key": "types",
"value": "api-group"
},
{
"key": "types",
"value": "connector"
},
{
"key": "types",
"value": "custom"
},
{
"key": "types",
"value": "example"
},
{
"key": "types",
"value": "extension"
},
{
"key": "types",
"value": "http-api"
},
{
"key": "types",
"value": "policy"
},
{
"key": "types",
"value": "raml-fragment"
},
{
"key": "types",
"value": "rest-api"
},
{
"key": "types",
"value": "soap-api"
},
{
"key": "types",
"value": "template"
},
{
"key": "domain",
"value": ""
},
{
"key": "organizationId",
"value": "{{organization_id}}"
},
{
"key": "masterOrganizationId",
"value": ""
},
{
"key": "offset",
"value": "0"
},
{
"key": "limit",
"value": "20"
},
{
"key": "sharedWithMe",
"value": ""
},
{
"key": "includeSnapshots",
"value": "true"
}
]
}
},
"response": [
]
}