We are trying to access data from Five9\'s server using there reporting API. We have written code below but are not getting any results. To me it looks like issue is with the Au
It looks like your problem is that your sending your base64 encoded username/password in the soap header. It actually needs to be included in the http header. My solution is in ruby but hopefully it can help you out.
soap_client = Savon.client(
endpoint: "https://api.five9.com/wsadmin/AdminWebService/",
namespace: "http://service.admin.ws.five9.com/",
headers: { "Authorization" => "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" },
env_namespace: :soapenv,
namespace_identifier: :ser,
ssl_verify_mode: :none
)
message = {
"lookupCriteria" => {
"criteria" => {
"field" => "email_address",
"value" => "something@example.com"
}
}
}
response = soap_client.call(:getContactRecords, message: message)
p response.body
So your XML ends up looking like this.
SOAP request: https://api.five9.com/wsadmin/AdminWebService/
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==, SOAPAction: "getContactRecords",
Content-Type: text/xml;charset=UTF-8, Content-Length: 471
email_address
something@example.com
HTTPI POST request to api.five9.com (httpclient)
SOAP response (status 200)
number1
email_address
5555555555
something@example.com