Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9177415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:19:18+00:00 2026-06-17T17:19:18+00:00

We are trying to access data from Five9’s server using there reporting API. We

  • 0

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 Authentication to Five9’s server. Please check help us understand how we can pull data for a specific campaign on regular interval of time and store it in out Data Warehouse.

<?php
$soapUser = "USERNAME";  //  username
$soapPassword = "DEMOPASSWORD"; // password

$soap_options   = array( 'login' => $soapUser, 'password' => $soapPassword );
$auth_details   = base64_encode($soapUser.":".$soapPassword);

$client = new SoapClient("https://api.five9.com/wsadmin/v2/AdminWebService?wsdl",       $soap_options);
$header = new SoapHeader("https://api.five9.com/wsadmin/v2/AdminWebService/getCallLogReport", "authentication", "Basic $auth_details"); 
//echo "Response:\n" . $client->__getLastResponse() . "\n";
$client->__setSoapHeaders($header);

$xml_data = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://service.admin.ws.five9.com/v2/AdminWebService/getCallLogReport">
<soapenv:Header/>
<soapenv:Body>
  <v2:getCallLogReport>
        <campaigns>Campaign1</campaigns>
  </v2:getCallLogReport>
</soapenv:Body>
</soapenv:Envelope>';

echo $result = $client->getCallLogReport($xml_data,   "https://api.five9.com/wsadmin/v2/AdminWebService?wsdl", "https://api.five9.com/wsadmin/v2/AdminWebService/getCallLogReport",0); 


?>  

Sample XML

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"  xmlns:v2="http://service.admin.ws.five9.com/v2/">
<soapenv:Header/>
<soapenv:Body>
  <v2:getCallLogReport>
     <!--Optional:-->
     <time>
        <!--Optional:-->
        <end>?</end>
        <!--Optional:-->
        <start>?</start>
     </time>
     <!--Optional:-->
     <criteria>
        <!--Optional:-->
        <ANI>?</ANI>
        <!--Zero or more repetitions:-->
        <agents>?</agents>
        <!--Zero or more repetitions:-->
        <callTypes>?</callTypes>
        <!--Zero or more repetitions:-->
        <campaigns>?</campaigns>
        <!--Optional:-->
        <DNIS>?</DNIS>
        <!--Zero or more repetitions:-->
        <dispositions>?</dispositions>
        <!--Zero or more repetitions:-->
        <lists>?</lists>
        <!--Zero or more repetitions:-->
        <skillGroups>?</skillGroups>
     </criteria>
  </v2:getCallLogReport>
  </soapenv:Body>
 </soapenv:Envelope>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T17:19:20+00:00Added an answer on June 17, 2026 at 5:19 pm

    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
    
    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ser="http://service.admin.ws.five9.com/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
      <soapenv:Body>
        <ser:getContactRecords>
          <lookupCriteria>
            <criteria>
              <field>email_address</field>
              <value>something@example.com</value>
            </criteria>
          </lookupCriteria>
        </ser:getContactRecords>
      </soapenv:Body>
    </soapenv:Envelope>
    
    HTTPI POST request to api.five9.com (httpclient)
    SOAP response (status 200)
    
    <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
      <env:Header></env:Header>
      <env:Body>
        <ns2:getContactRecordsResponse xmlns:ns2="http://service.admin.ws.five9.com/" xmlns:ns3="http://service.admin.ws.five9.com/v1/">
          <return>
            <fields>number1</fields>
            <fields>email_address</fields>
            <records>
              <values>
                <data>5555555555</data>
                <data>something@example.com</data>
              </values>
            </records>
          </return>
        </ns2:getContactRecordsResponse>
      </env:Body>
    </env:Envelope>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to transfer some data from Access to SQL Server 2000 (there are
Hey there, I am trying to access raw data from iphone camera using AVCaptureSession.
I'm trying to pull in data from a remote SQL Server. I can access
I'm trying to access list data using SSRS 2008. I have created an XML
I am using the Exchange Managed API in C# to access data from Exchange
I am trying to access the data from MS Access Database using C#. in
I have been trying to access some data from a website. I have been
Am trying to access an API using CURL I can access the API from
I am trying to access data from list view using columnheader name but I
I have been trying to access data from another site by ajax but failed.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.