SOAP Message Examples
This documentation does not apply to the most recent version of Splunk. Click here for the latest version.
Contents
SOAP Message Examples
Here are examples of a full SOAP message, including the XML, SOAP body and envelope.
Login
POST https://defiant.splunk.com:18089 HTTP/1.1 Accept: text/xml Accept: multipart/* Accept: application/soap Content-Length: 642 Content-Type: text/xml; charset=utf-8 SOAPAction: "urn:m2c-ManagementService#invokeAPI" <?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <invokeAPI xmlns="urn:m2c-ManagementService"> <apiData xsi:type="xsd:string"><call name="userLogin"><params><login><username>admin< /username><password>changeme</password></login>< / params></call></apiData> </invokeAPI> </soap:Body> </soap:Envelope>
Execute Query
POST https://defiant.splunk.com:18089 HTTP/1.1 Accept: text/xml Accept: multipart/* Accept: application/soap Content-Length: 925 Content-Type: text/xml; charset=utf-8 SOAPAction: "urn:m2c-ManagementService#invokeAPI" <?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <invokeAPI xmlns="urn:m2c-ManagementService"> <apiData xsi:type="xsd:string"><call name="executeQuery"><params> <auth><userId>1</userId><username>admin</username> <authToken>3135052749</authToken></auth> <query>SEARCH error GET events::0-9 OUTPUT maxlines::14 splunkui::2.1 summary::2.1 format::all "timeformat::%m/%d/%Y, %H:%M:%S"</query><user>admin</user>< queryId>1234567890</queryId></params></call> </apiData> </invokeAPI> </soap:Body> </soap:Envelope>
This documentation applies to the following versions of Splunk: 2.2 , 2.2.1 , 2.2.3 , 2.2.6 View the Article History for its revisions.