Action: GetAttribute

Purpose: Retrieves the value of a named attribute for a specified Element, if it exists

Action-specific name/value pairs:

Parameter Name Description
AttributeName The Name of the Attribute.
ElementOID The Element that owns the Attribute.

Alternatively, the parameters above can be incorporated into a single JSON string and specified using the parameter name JSON, eg:

{AttributeName:"myAttrib",ElementOID:"1-4"}

Example Request

Action=GetAttribute
&AttributeName=myAttrib
&ElementOID=1-4
&MDBAccessKeyId=[your access key id]
&Signature=[computed signature]
&SignatureMethod=HmacSHA256
&SignatureVersion=2
&Timestamp=2009-06-14T13%3A19%3A41
&Version=2009-04-15
&db=mdbx

or:

Action=GetAttribute
&JSON=%7BAttributeName%3A%22myAttrib%22%2CElementOID%3A%221-4%22%7D
&MDBAccessKeyId=[your access key id]
&OutputFormat=JSON
&Signature=[computed signature]
&SignatureMethod=HmacSHA256
&SignatureVersion=2
&Timestamp=2009-06-14T13%3A19%3A41
&Version=2009-04-15
&db=mdbx

Example Response

XML

<?xml version='1.0'?>
<GetAttributeResponse xmlns="http://mdbx.mgateway.com/doc/2009-06-05/">
   <GetAttributeResult>
      <AttributeExists>
         true
      </AttributeExists>
      <Value>
         testid
      </Value>
      <AttributeOID>
         1-15
      </AttributeOID>
   </GetAttributeResult>
</GetAttributeResponse>

JSON (ie if OutputFormat=JSON specified in the Request)

{exists:true,AttributeValue:"testid",AttributeOID:"1-15"}

The GetAttribute Action returns whether or not the specified attribute exists for the Element, and if it does exist, it returns the value and OID of the Attribute Node.

So in the example above, the specified Element has the attribute myAttrib='testid'