Closed fastesol closed 5 years ago
Thanks for reaching out, it looks like the error message got cut off, but it might have been "Invalid email address" since we don't have any others that start with "in" as far as I recall.
If you think it might be an invalid email then make sure you've specified a real email address and there's nothing goofy like an extra space or something going on and that the email isn't too long (50 characters max).
If you don't want to paste your account / list / test email details here in github you can send us an email at api@aweber.com with those and we can take a deeper look into the logs for you.
I'm currently unable to replicate any issues with this script so I think we've just got some simple thing like a problem with the email address on our hands here.
Kaitlyn C.
Hi Kaitlyn, thank you for the quick reply. Here is the complete code snippet to create subscription.
const ACCOUNT_ID = 1382823;
const LIST_ID = 5329970;
$body = [
'email' => 'info@fastesol.com'
];
$headers = [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer ' . $accessToken
];
$url = "https://api.aweber.com/1.0/accounts/".ACCOUNT_ID."/lists/".LIST_ID."/subscribers/?ws.op=create";
$response = $client->post($url, ['json' => $body, 'headers' => $headers]);
Well, I tried adding the try/catch block and used die($e->getResponse()->getBody()->getContents());
to check the error and here it is.
{"error": {"status": 400, "documentation_url": "https://labs.aweber.com/docs/troubleshooting#badrequest", "message": "email: Email address blocked. Please refer to https://help.aweber.com/hc/en-us/articles/204029356 .", "type": "WebServiceError"}}
Hello,
The email addresses starting with info@, contact@, support@, etc are what AWeber calls role-based email addresses. These are not permitted to be added via the API. The potential for spam complaints is drastically higher for these types of email addresses, as they are typically used as catchall inboxes. For a bit more information please take a look at the Knowledge Base article below, or the one in the error you posted. They're pretty similar.
These email addresses can only be added from an HTML sign up form and will always be required to confirm.
I'd suggest using a different email address. If your email host allows you to make extra addresses with forwarding you could make one like
Thanks for letting us know about the documentation issue, @fastesol. I've updated the documentation on api.aweber.com to remove the ws.op parameter from the add subscriber endpoint.
Thank you! Its working with different email address
Hi, while working on the API, I found that there are some missing or incorrect information in the documentation or may be I have miss interpreted.
I'm following this documentation to add subscriber to an account/list
First of all, as you see the
ws.op
parameter is required, but the example doesn't show the use ofws.op
parameter.Secondly, I've tried adding the subscriber using the following code
and got the following error
Also tried appending the '?ws.op=create' in url but nothing works.
Please help, Thank you!