Add Resource
The AddResource method of the Resource API adds a single resource object to the system, returning a status document.
This operation is an http POST on the base URL of the API with a resource object included in the POST body.
Use the Content-Type header to inform the API of the mediatype you are using for the included resource object, and
the Accept header to determine the mediatype the API will return. Acceptable mediatypes are as described in the API Overview.
Sample Requests
JSON Request
POST /resource HTTP/1.1
Authorization: Atmosphere realm=http://atmosphere,atmosphere_app_id=
,atmosphere_signature_method=NONE;
Accept: application/json
User-Agent: SOA Software HTTP Client Transport
Host: demo2-broker.atmos.phe.re
Transfer-Encoding: chunked
Content-Type: application/json
{
"city":"City596989997",
"first":"First596989997",
"last":"Last596989997",
"line1":"Line1596989997",
"phone":"Phone: 596989997",
"state":"CA",
"zip":"55555",
"ID":"596989997",
"SSN":"596989997"
}
XML Request
POST /resource HTTP/1.1
Authorization: Atmosphere realm=http://atmosphere,atmosphere_app_id=
,atmosphere_signature_method=NONE;
Accept: text/xml
User-Agent: SOA Software HTTP Client Transport
Host: demo2-broker.atmos.phe.re
Transfer-Encoding: chunked
Content-Type: text/xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Resource xmlns="http://demo.soa.com/resource/1.0">
<city>City746424366</city>
<first>First746424366</first>
<ID>746424366</ID>
<last>Last746424366</last>
<line1>Line1746424366</line1>
<phone>Phone: 746424366</phone>
<SSN>746424366</SSN>
<state>CA</state>
<zip>55555</zip>
</Resource>
For more details on how to specify the authentication header, and on API security in general, please see the API Overview document.
Sample Responses
JSON Response
HTTP/1.1 200 OK
Date: Wed, 18 Apr 2012 18:12:30 GMT
Content-Type: application/json
Transfer-Encoding: chunked
{
"status" : true,
"description" : "Resource: 596989997 successfully added",
"timestamp" : "Wed Apr 18 18:12:30 UTC 2012"
}
XML Response
HTTP/1.1 200 OK
Date: Wed, 18 Apr 2012 21:42:31 GMT
Content-Type: application/json
Content-Encoding: gzip
Transfer-Encoding: chunked
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Status xmlns="http://demo.soa.com/resource/1.0">
<status>true</status>
<description>Resource: 746424366 successfully added</description>
<timestamp>Thu Apr 19 01:36:10 UTC 2012</timestamp>
</Status>
back to top