Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Error codeMeaning
1xxInformation. Stay tuned, operation is in progress.
2xx

Success. Operation finished successfully. There are two custom codes:

  • 250 for partial error which means that during processing some error occurred but some changes was executed. 
  • 240 for handled error which means that there was originally error, but midPoint was able to fix this using its consistency mechanism.

In this two cases, midPoint returns the OperationResult where there details of executed operations can be found.

3xx

Redirection or "in progress". This is returned mostly to indicate two cases:

  • Operation has finished, but the results are not in this resource. Redirection is issues to point the client to the results. Typical example is creation of an object with POST to a collection web resource. In this case a new object is created, new URI is assigned and the client is redirected to this URI. Retrieving that URI provides created object and 200 status code, indicating that the operation is finished.
  • Operation is in progress (asynchronous operation). In this case midPoint API redirects the client to a task object that can be used to track progress of the operation.
4xx

Client errors. The client has sent request that cannot be processed. This indicates usual situation that are well handled by the midPoint code. Maybe the client request to create conflicting object, delete non-existent object, modification that violates the schema an so on.

The OperationResult structure is usually provided in the response to provide more details about the situation.

5xx

Server errors. Situations that the server cannot handle and where the cause is unknown. This usually means bugs in the code, insufficient resources such as RAM or disk space, unforeseen failures in the infrastructure and so on.

The OperationResult structure might or might not be provided in this case. Some errors are so severe that the structured error information might not be available.

...

  • Use the base URL + path from the table below to request concrete operation. 
  • Supply the {type} with the concrete type of object you want to add (or modify, delete, search, etc). Supported types are listed in Table 1 above.
  • Supply the {oid} with the concrete oid of your object.

 


Operation nameOperation typePathDataResponse
Create new objectPOST

/{type} 

Object to create in the XML form201 Created, Location set to point to the newly created object
Create or update objectPUT

/{type}/{oid}

Object to create in the XML form201 Created, Location set to point to the newly created object
Get objectGET/{type}/{oid}-

200 OK, current object in the response body

Modify object  PATCH, POST/{type}/{oid}Modifications in XML format204 No Content
Delete objectDELETE/{type}/{oid}-204 No Content

Test (configured) Resource

POST/resources/{oid}/test-200 OK, result of the test operation in the body

Import from Resource

POST

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

-

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

Find owner of shadow

GET

/shadows/{oid}/owner

-

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

Import shadow

POST

/shadows/{oid}/import

-

200 OK, result of the import operation in the body

SearchPOST

/{type}/search

Query in XML format200 OK, list of found objects in the body
Suspend tasksPOST/tasks/{oid}/suspend-204 No Content
Resume tasksPOST/tasks/{oid}/resume-202 Accepted
Schedule task nowPOST/tasks/{oid}/run-202 Accepted
Notify changePOST/notifyChangeResource object shadow change description200 OK

 


Sample usage

Info

If you are using file as a source for the data in the REST call, please, don't forget to use '@' before the path to your file

...

curl.exe --user administrator:5ecr3t -H "Content-Type: application/xml" -X POST http://localhost:8080/midpoint/ws/rest/users/search -d @pathToMidpointGit\samples\rest\query-all-users.xml

 


Notify change

curl.exe --user administrator:5ecr3t -H "Content-Type: application/xml" -X POST http://localhost:8080/midpoint/ws/rest/notifyChange -d @pathToMidpointGit\samples\rest\notify-change-modify-password.xml -v

...

Version

Date

Description

Change Author

3.3December 2015Declared as stable versionRadovan Semancik

 2013-2015untracked improvements

Katarina Valalikova


 

April 2013

Initial version

Katarina Valalikova

...