To add a repository item, send a REST Web Services request as described in the following table.
Request Component | Value |
---|---|
HTTP Method | POST |
Functional Parameters | Include all required property values for the new repository item as functional parameters with the REST Web Services request. |
URL | Include the component pathname of the repository in the application path after |
The following example shows a REST Web Services request that creates a new repository item in the /atg/userprofiling/ProfileAdapterRepository
repository. The returned data includes all the property values for the new item.
curl -v -b cookies.txt -X POST -H "Content-Type: application/xml" \ -d "<parameters><login>rbriere</login><lastName>Briere</lastName><firstName>Roland</firstName><email>rbriere@example.com</email><password>mypassword</password></parameters>" \ http://myserver:8080/rest/repository/atg/userprofiling/ProfileAdapterRepository/user * About to connect() to myserver port 8080 (#0) * Trying 12.34.567.890... connected * Connected to myserver (12.34.567.890) port 8080 (#0) > POST /rest/repository/atg/userprofiling/ProfileAdapterRepository/user HTTP/1.1 > User-Agent: curl/7.21.1 (i386-pc-win32) libcurl/7.21.1 zlib/1.2.5 > Host: myserver:8080 > Accept: */* > Cookie: DYN_USER_ID=140003; JSESSIONID=F9C672B8E52D2033A1B70C4EE225577F; DYN_USER_CONFIRM=1231cf3e7573bf936dbd29dbbbfe150b > Content-Type: application/xml > Content-Length: 168 > < HTTP/1.1 201 Created < Server: Apache-Coyote/1.1 < X-Powered-By: Servlet 2.5; JBoss-5.0/JBossWeb-2.1 < X-ATG-Version: version=QVRHUGxhdGZvcm0vMTAuMCxDb21tZXJjZVJlZmVyZW5jZVN0b3JlLzEwLjAgWyBQbGF0Zm9 ybUxpY2Vuc2UvMCBCMkNMaWNlbnNlLzAgIF0= < Content-Type: application/xml;charset=UTF-8 < Transfer-Encoding: chunked < Date: Mon, 01 Nov 2010 17:35:29 GMT < <?xml version="1.0" encoding="UTF-8"?> <atgResponse> <repositoryId>130030</repositoryId> <securityStatus>4</securityStatus> [Additional property values omitted to save space] <lastPurchaseDate/> <lastName>Briere</lastName> <gender>unknown</gender> <salePriceList/> <categoryLastBrowsed/> [Additional property values omitted to save space] <registrationDate>2010-11-01 13:35:28.742</registrationDate> <dateOfBirth/> <member>false</member> <firstName>Roland</firstName> <billingAddress/> [Additional property values omitted to save space] <Young>false</Young> <WomenOnly>false</WomenOnly> </atgResponse> * Connection #0 to host myserver left intact * Closing connection #0