Chilkat Online Tools

Objective-C / Anypoint Platform APIs / Get all conditional assignments

Back to Collection Items

#import <CkoHttp.h>
#import <CkoJsonObject.h>
#import <CkoHttpResponse.h>

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

CkoHttp *http = [[CkoHttp alloc] init];
BOOL success;

CkoJsonObject *queryParams = [[CkoJsonObject alloc] init];
[queryParams UpdateString: @"intent" value: @"role_assignment"];

// Adds the "Authorization: Bearer {{token}}" header.
http.AuthToken = @"{{token}}";

CkoHttpResponse *resp = [http QuickRequestParams: @"GET" url: @"https://domain.com/accounts/api/cs/conditionalAssignments" json: queryParams];
if (http.LastMethodSuccess == NO) {
    NSLog(@"%@",http.LastErrorText);
    return;
}

NSLog(@"%d",[resp.StatusCode intValue]);
NSLog(@"%@",resp.BodyStr);

Curl Command

curl -G -d "intent=role_assignment"
	-H "Authorization: Bearer {{token}}"
https://domain.com/accounts/api/cs/conditionalAssignments

Postman Collection Item JSON

{
  "name": "Get all conditional assignments",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Authorization",
        "value": "Bearer {{token}}",
        "type": "text"
      }
    ],
    "url": {
      "raw": "{{url}}/accounts/api/cs/conditionalAssignments?intent=role_assignment",
      "host": [
        "{{url}}"
      ],
      "path": [
        "accounts",
        "api",
        "cs",
        "conditionalAssignments"
      ],
      "query": [
        {
          "key": "intent",
          "value": "role_assignment"
        }
      ]
    }
  },
  "response": [
  ]
}