API not working

This gives an error: 'Moved Permanently'.
Can you confirm your server supports the PUT http method? It seems it does not, and instead responds with that error message.
Some servers only allow GET and POST by default. So methods like PUT(which are used for updates) or DELETE (which are used for delete) are not allowed and won't work, you must allow them at your web server level.
 
I can confirm that our server does support the http PUT method. It is enabled.
So maybe I'm doing something wrong.
 
Alright, I tested a bit further with a plain form, instead of the PHP cURL. Just to see how that works.

This is de PHP code to test:
$protocol = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
$path = $protocol.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']);

$Email = 'test@test.com';
$FirstName = 'Test';

$PostToUrl = $path . '/list-subscribe';

/* List ID */
$List = 'kf469p9yhp0f8';

/* Just checking the var's */
echo 'Path: ' . $path . '<br>';
echo 'Email: ' . $Email . '<br>';
echo 'FirstName: ' . $FirstName . '<br>';
echo 'PostToUrl: ' . $PostToUrl . '<br>';
echo 'List: ' . $List . '<br>';
?>

<form action="<?=$PostToUrl?>" method="post" accept-charset="utf-8" target="_blank">
<input type="text" name="list" value="<?=$List?>" />
<input type="text" name="EMAIL" value="<?=$Email?>" required />
<input type="text" name="DO_ORDERED" value="YES" />
<input type="text" name="FNAME" value="<?=$FirstName?>"/>
<button type="submit">Update</button>
</form>

The form is filled with all variables. (see screenshot)
However, when submitting the form, I get "Missing list id".
 

Attachments

  • Screenshot_5.jpg
    Screenshot_5.jpg
    31.8 KB · Views: 7
Okay, got the error with Missing List ID fixed. All posted data is now correctly received by the index.php file.
When submittind data, I get a blank screen. No errors anymore.
But the data is not changed in MailWizz.

How can I further check the output to see what the API is trying to do?
 
Back
Top