1
Old API calls not working?
Problem reported by YS Tech - 3/4/2024 at 4:58 AM
Resolved
Is anyone else having issues with previously working API code not working any more?
I'm trying to populate a mailing list using /Services/svcMailListAdmin.asmx/SetSubscriberList2 but i'm just getting this returned:

Missing value for parameter(s): "SetSubscriberList2", (AuthUserName, AuthPassword, DomainName, ListName, Subscribers)
Obviously, I am sending this info as before, but it's not now seeing it.
Are these API calls now depreciated or not working or are there other parameters i'm missing?
Thanks

3 Replies

Reply to Thread
0
YS Tech Replied
I've also tried with the new API and I receive no response, using:

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://myserver/api/v1/auth/authenticate-user',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{ 
    "username": "email@email.com", 
    "password": "emailpassword" 
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$returned = curl_exec($curl);

curl_close($curl);
echo "Returned: ". $returned ."<BR>";
All I see on the screen is "Returned:"
I have nothing to process, am I missing something?
Thanks

0
Sébastien Riccio Replied
Seems legit, but you have a lonely semicolon here:

CURLOPT_URL => 'https://myserver/api/v1/auth/authenticate-user';,

I tried your code removing it:

r00tshell@mx1-ng:~/scripts# php test.php 

Returned: {"emailAddress":"","changePasswordNeeded":false,"passwordExpired":false,"displayWelcomeWizard":false,"isAdmin":false,"isDomainAdmin":false,"isLicensed":true,"autoLoginToken":"","autoLoginUrl":"","localeId":"en","requirements":null,"isImpersonating":false,"canViewPasswords":false,"accessToken":"","refreshToken":"","accessTokenExpiration":null,"refreshTokenExpiration":null,"username":null,"success":false,"resultCode":401,"message":"LOGIN_FAILURE_DOMAIN_NOT_FOUND"}<BR>
There is an answer... Of course wrong login as I didn't changed the credentials...
Sébastien Riccio System & Network Admin https://swisscenter.com
0
YS Tech Replied
Marked As Resolution
Strange that, the code I have doesn't have that stray semicolon in there, so not sure why it was posted here! Edited.

Found the issue I believe, Postman threw me.
OK for some reason Postman works with a URL that I thought was the default mail server, BUT when I changed this to the correct default domain the code started to work.
So there must be something in Postman that's different to when you write it up in code.
Anyway, the above does now return the data i'm after!

Reply to Thread