REST Operations

Last modified 27 Feb 2024 09:31 +01:00
Table of Contents

Supported Operations

The base URL of REST API is http://localhost:8080/midpoint/ws/rest (alternatively to /ws/rest paths /api/model and /rest/model are also supported).

  • Use the base URL + path from the table below to request concrete operation.

  • Supply the {type} with the specific type of object you want to add (or modify, delete, search, etc). Supported types are listed here

  • Supply the {oid} with the specific oid of your object.

  • Some operations support specifying options influencing the operation execution, e.g. if the execution is made in raw mode, or the shadows are not fetched from the resource, etc. Supported options column shows supported options for different operations. To specify option, use query parameters, e.g. http://localhots:8080/midpoint/api/model/users*?options=raw*

  • The data in the body should be written in one of the supported Media Types

Operation name Operation type Path Supported options Data Response

Create new object

POST

/{type}

ModelExecuteOptionsType

Object to create

  • 201 Created, Location set to point to the newly created object

  • 240 Handled error, OperationResult is returned in the body

  • 250 Partial error, OperationResult is returned in the body

Create or update object

PUT

/{type}/{oid}

ModelExecuteOptionsType

Object to create

  • 201 Created, Location set to point to the newly created object

  • 240 Handled error, OperationResult is returned in the body

  • 250 Partial error, OperationResult is returned in the body

Get object

GET

/{type}/{oid}

GetOperationOptionsType

-

  • 200 OK, current object in the response body

Modify object

PATCH, POST

/{type}/{oid}

ModelExecuteOptionsType

Modifications as in ObjectModificationType

Delete object

DELETE

/{type}/{oid}

ModelExecuteOptionsType

-

Test (configured) Resource

POST

/resources/{oid}/test

No

-

  • 200 OK, result of the test operation in the body

Import from Resource

POST

/resources/{oid}/import/{objectClass}

No

-

  • 303 See Other, Location set to point to the concrete "import" task

Find owner of shadow

GET

/shadows/{oid}/owner

No

-

  • 200 OK, owner of the shadow returned in the response body

Import shadow

POST

/shadows/{oid}/import

No

-

  • 200 OK, result of the import operation in the body

Search

POST

/{type}/search

GetOperationOptionsType

Query as in QueryType

  • 200 OK, list of found objects in the body

Suspend tasks

POST

/tasks/{oid}/suspend

No

-

  • 204 No Content

Resume tasks

POST

/tasks/{oid}/resume

No

-

  • 202 Accepted

Schedule task now

POST

/tasks/{oid}/run

No

-

  • 202 Accepted

Notify change

POST

/notifyChange

No

Resource object shadow change description

  • 200 OK

Generate value for concrete object

POST

/{type}/{oid}/generate

No

Policy for items describing how to generate the value (PolicyItemsDefinitionType)

Generate value

POST

/rpc/generate

No

PolicyItemsDefinitionType

Validate value for concrete object

POST

/{type}/{oid}/validate

No

PolicyItemsDefinitionType

Validate value

POST

/rpc/validate

No

PolicyItemsDefinitionType

Get user’s value policy

GET

/users/{oid}/policy

No

  • 200 OK, value policy for user in the response body

Get 'self'

GET

/self

No

  • 200 OK, current object in the response body

Search objects by type

GET

/{type}

GetOperationOptionsType

  • 200 OK, list of object of specified type in the response body

Reset credentials

POST

/users/{oid}/credential

No

ExecuteCredentialResetRequestType - specify reset method and new password

  • 200 OK, ExecuteCredentialResetResponseType returned in the body.

Execute script

POST

/rpc/executeScript

No

ExecuteScriptType

  • 200 OK, ExecuteScriptResponseType returned in the body

  • 201 Created, Location set to point to the newly created Task object. Only applicable is asynchronous=true parameter is used.

  • 240 Handled error, OperationResult is returned in the body

  • 250 Partial error, OperationResult is returned in the body

Was this page helpful?
YES NO
Thanks for your feedback