Topics
This section provides information on making REST requests with the Amazon SimpleDB web service.
Amazon SimpleDB REST calls are made using HTTP GET requests. The Action query parameter provides the method called and the URI specifies the target of the call. Additional call parameters are specified as HTTP query parameters. The response is an XML document that conforms to a schema.
![]() | Note |
|---|---|
If the length of the query string that you are constructing exceeds the maximum length of the HTTP GET URL, use HTTP POST and submit the query string parameters in the body of the message. |
In a REST request, the components are specified as separate parameters that are prefixed with an ampersand (&). The following is an example of the DomainName parameter.
&DomainName=MyDomain
Parameters that have components start with the main parameter name (such as Attribute), a dot, a sequence number, a dot, and the component name (such as Name). For example: &Attribute.1.Name=Color.
In addition to the parameters found in request data structures, REST requests have parameters to indicate the name of the service and the version of the API. For more information about these parameters and their values, see API Conventions and API Versioning.
This section provides a sample REST request and response.
The following shows a REST request that puts three attributes and values for an item named Item123 into the domain named MyDomain.
https://sdb.amazonaws.com/?Action=PutAttributes
&DomainName=MyDomain
&ItemName=Item123
&Attribute.1.Name=Color&Attribute.1.Value=Blue
&Attribute.2.Name=Size&Attribute.2.Value=Med
&Attribute.3.Name=Price&Attribute.3.Value=0014.99
&AWSAccessKeyId=<valid_access_key>
&Version=2007-11-07
&Signature=Dqlp3Sd6ljTUA9Uf6SGtEExwUQE=
&SignatureVersion=1
&Timestamp=2007-06-25T15%3A01%3A28-07%3A00
The following is the sample response:
<PutAttributesResponse xmlns="http://sdb.amazonaws.com/doc/2007-11-07">
<ResponseMetadata>
<StatusCode>Success</StatusCode>
<RequestId>f6820318-9658-4a9d-89f8-b067c90904fc</RequestId>
<BoxUsage>0.0000219907</BoxUsage>
</ResponseMetadata>
</PutAttributesResponse>