Chilkat Online Tools

Objective-C / ForgeRock Identity Cloud Collection / Step 4: Delete a Managed Identity

Back to Collection Items

#import <CkoHttp.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;

[http SetRequestHeader: @"X-OpenIDM-Username" value: @"{{adminUsername}}"];
[http SetRequestHeader: @"Accept-API-Version" value: @"resource=1.0"];
[http SetRequestHeader: @"X-OpenIDM-Password" value: @"{{adminPassword}}"];
// Adds the "Authorization: Bearer <access_token>" header.
http.AuthToken = @"<access_token>";

CkoHttpResponse *resp = [http QuickRequest: @"DELETE" url: @"https://<tenant-name>.forgeblocks.com/openidm/managed/alpha_user/:_id"];
if (http.LastMethodSuccess == NO) {
    NSLog(@"%@",http.LastErrorText);
    return;
}

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

Curl Command

curl -X DELETE
	-H "Authorization: Bearer <access_token>"
	-H "Accept-API-Version: resource=1.0"
	-H "X-OpenIDM-Username: {{adminUsername}}"
	-H "X-OpenIDM-Password: {{adminPassword}}"
https://<tenant-name>.forgeblocks.com/openidm/managed/alpha_user/:_id

Postman Collection Item JSON

{
  "name": "Step 4: Delete a Managed Identity",
  "event": [
    {
      "listen": "prerequest",
      "script": {
        "exec": [
          ""
        ],
        "type": "text/javascript"
      }
    }
  ],
  "request": {
    "method": "DELETE",
    "header": [
      {
        "description": "(Required) ",
        "key": "Accept-API-Version",
        "value": "resource=1.0",
        "disabled": true
      },
      {
        "key": "X-OpenIDM-Username",
        "type": "text",
        "value": "{{adminUsername}}"
      },
      {
        "key": "X-OpenIDM-Password",
        "type": "text",
        "value": "{{adminPassword}}"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "",
      "options": {
        "raw": {
          "language": "json"
        }
      }
    },
    "url": {
      "raw": "{{platformUrl}}/openidm/managed/alpha_user/:_id",
      "host": [
        "{{platformUrl}}"
      ],
      "path": [
        "openidm",
        "managed",
        "alpha_user",
        ":_id"
      ],
      "variable": [
        {
          "key": "_id",
          "value": "{{managedUserId}}"
        }
      ]
    }
  },
  "response": [
    {
      "name": "Success",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "(Required) ",
            "key": "Accept-API-Version",
            "value": "<string>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/openidm/managed/user#1.0_query_filter?_fields=&_prettyPrint=true&_queryFilter=<string>&_pageSize=<integer>&_totalPagedResultsPolicy=<string>&_sortKeys=<string>",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "openidm",
            "managed",
            "user"
          ],
          "hash": "1.0_query_filter?_fields=&_prettyPrint=true&_queryFilter=<string>&_pageSize=<integer>&_totalPagedResultsPolicy=<string>&_sortKeys=<string>"
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "*/*"
        }
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}