How to access this api using soap call?

Hi I'm trying to setup an api service with Limoanywhere system. But regardless of what I do I get invalid ApiKey & ApiID. I went into the back system and changed the ApiKey & ApiId multiple times but still no success.

Can anyone tell me if my code is correct?

<?php
$client = new SoapClient('https://qa.book.mylimobiz.com/api/ApiService.asmx?wsdl');
$options = array(
                'ApiKey' => '***api key here****',
                'ApiID'  => '***api id here****'
                );
$result = $client->__soapCall('Test', $options);
//var_dump($client->__getFunctions());
print_r($result);
?>

Open in new window


Here is the service detail.

http://qa.book.mylimobiz.com/api/ApiService.asmx?op=Test

This is my error.

Array ( [TestResult] => Array ( [ResponseCode] => 1 [ResponseText] => Invalid ApiId or ApiKey ) )

Open in new window

nomie7Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GaryCommented:
'ApiID'  => 'ApiId'
Linux systems and (PHP) are case sensitive - ApiID is not the same as ApiId
0
nomie7Author Commented:
same error after 'ApiID'  => 'ApiId'

stdClass Object ( [TestResult] => stdClass Object ( [ResponseCode] => 1 [ResponseText] => Invalid ApiId or ApiKey ) )

Open in new window

0
GaryCommented:
Think I may have confused you with my comment I was trying to say that

'ApiID'  => '***api id here****'

...should be...

'ApiId'  => '***api id here****'
0
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

nomie7Author Commented:
That is exactly what I did. I did understand what you were trying to say. But it just doesnt work.


<?php

$client = new SoapClient('https://qa.book.mylimobiz.com/api/ApiService.asmx?wsdl', array('exceptions' => 0,'cache_wsdl' => WSDL_CACHE_NONE,));

$options = array(
				'ApiKey'     => '*** Key ***',
				'ApiId'	 =>	'*** Id ****'
				);

$result = $client->__soapCall('Test', $options);
//var_dump($client->__getFunctions());
if (is_soap_fault($result)) {
    trigger_error("SOAP Fault: (faultcode: {$result->faultcode}, faultstring: {$result->faultstring})", E_USER_ERROR);
}
print_r($result);
?>

Open in new window

0
Rose BabuSenior Team ManagerCommented:
have you given the valid ApiKey and ApiId value? the soap call is formatted correctly and the response is also coming correctly.

<?php

$client = new SoapClient('https://qa.book.mylimobiz.com/api/ApiService.asmx?wsdl');

$options = array(
				'ApiKey'     => '*** Key ***',
				'ApiId'	 =>	'*** Id ****'
				);

$result = $client-> Test($options);

print_r($result);

?>

Open in new window

stdClass Object
(
    [TestResult] => stdClass Object
        (
            [ResponseCode] => 1
            [ResponseText] => Invalid ApiId or ApiKey
        )

)

Open in new window

Can you try once with the correct ApiKey and ApiId value?
0
nomie7Author Commented:
you can try it

'apiKey'     => 'm23IEETGsi1f9Ux'
				'apiId'	 =>	'$9o3fKr@p9peBSCiR6U#'

Open in new window

0
Rose BabuSenior Team ManagerCommented:
stdClass Object
(
    [TestResult] => stdClass Object
        (
            [ResponseCode] => 1
            [ResponseText] => Service Type is invalid
        )
)

Open in new window

This is the response received for your apiKey and apiId
0
Rose BabuSenior Team ManagerCommented:
The problem is with the Test webmethod...

try to test GetAffiliates web method. it returns the response correctly.

<?php

$client = new SoapClient('https://qa.book.mylimobiz.com/api/ApiService.asmx?wsdl');
         
$options = array('apiId' => 'm23IEETGsi1f9Ux',
                 'apiKey' => '$9o3fKr@p9peBSCiR6U#');

$result = $client-> GetAffiliates($options);

print_r($result);

?>

Open in new window

If possible contact the service provider's support to check why the Test web method returning the "Service Type is invalid" response text
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.