objectClass("User") {
create {
endpoint(POST, "/users") {
request {
contentType APPLICATION_JSON
}
}
}
}
Create Script
Create scripts are used to determine how to create new objects using the target system’s API.
Basic Create Script Example using POST
The simplest create script for User object class could look like this:
Where:
-
this simplest script heavilly relies on default behavior of connector framework.
-
The
endpointmethod specifies the endpoint to be used for create operation. -
The
httpOperationmethod specifies the HTTP method to be used. -
The
requestmethod allows to customize the request. In this case we specify that the content type of the request is JSON.-
If no body
implementationis specified, the default implementation will be used which will serialize allcreatableattributes from theobjectClassinto JSON body. -
If no
responseis specified, the response will be handled by default implementation which expects that the created object is returned in the response body in JSON format. -
Attributes which are
updateablebut notcreatablewill be automatically handled by the framework after the object is created, by issuing anupdateoperation (if implemented) immediately after thecreateoperation.
-