Create Object

Last modified 05 Feb 2024 11:58 +01:00
Table of Contents

Description

Example of creating an midPoint object either representing some identity data in the form of a new User type object or the creation of a new midPoint resource object.

For the purpose of the sample we are using the CURL tool as it is a well maintained, well tested, and it’s widely accessible.

The body of the request will contain data from an external configuration file, the data will be inserted into the request via native Curl commands.

Authentication methods used to work with the REST api

Authentication methods

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

Sometimes the newlines are not correctly handled during the transfer. (See MID-5229.) If that occurs, please use --data-binary instead of -d.

Example

Create a new Resource object in MidPoint with file data source
# Authenticating with the credentials "administrator" and password "5ecr3t" on a localhost instance running on port 8080
curl --user administrator:5ecr3t -H "Content-Type: application/xml" -X POST http://localhost:8080/midpoint/ws/rest/resources -d @pathToMidpointGit\samples\rest\opendj-resource-sync.xml -v
Show data source example for *"Create a new Resource object in MidPoint"
link:https://raw.githubusercontent.com/Evolveum/midpoint-samples/master/samples/rest/opendj-resource-sync.xml[role=include]
Was this page helpful?
YES NO
Thanks for your feedback