Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the Aweber API Variables $account_id and $list_id?

You can check here: https://labs.aweber.com/docs/code_samples/subs/create

The script to add a new subscriber to the list via api requires those two pieces info...only I cannot figure out for the life of me what those two variables are!! I've beaten through every little aspect of my Aweber Subscriber Account, AND my Aweber Labs account...and I can't find any reference to either of those variables anywhere. I've submitted some tickets to them, and haven't gotten any response yet.

Does anyone have any ideas here? I've tried my account names, my list names, to no avail!

~~~~~~~~~~~~~~~~~~~~~~~~~~~

Okay, I've got it! You can get the values of both of these variables by dumping some other variables in the aweber api after making certain api calls.

get the account id first:

$account = $aweber->getAccount($accessKey, $accessSecret);

then vardump or print_r $account.

next we get the list id:

$account = $aweber->getAccount($accessKey, $accessSecret);
$list_url = 'https://api.aweber.com/1.0/accounts/<id>/lists';
$lists = $account->loadFromUrl($list_url);

then vardump or print_r $lists.

And you are all set! I'm so happy I figured this out, it freakin took long enough. Hopefully this saves some one a bit of time.

like image 684
Jared Smith Avatar asked Dec 27 '22 21:12

Jared Smith


2 Answers

I too have agonized over finding the $list_ID, so went to deactivate the list, and create a new one, and "discovered" that if you hover over the Deactivate button, you get a url you can copy, and this gives both %account and %list Ids

https://www.aweber.com/users/lists/deactivate/$accountID/$lisID

like this.... https://www.aweber.com/users/lists/deactivate/123456/123456

Hopefully this will help make someone as it is a super easy solution

like image 158
Anne Allen Avatar answered Jan 29 '23 12:01

Anne Allen


The proper answer is Anne Allen's one, but...

Check the return of the /accounts endpoint. It should return the same account id as you detected in the link, but I had cases they were different (strange, isn't it?). Use the account id returned by the /accounts endpoint and other endpoints to retrieve lists, subscribers, etc. will start to work. It's like if some accounts have two ids, one partially works and the other fully works.

like image 44
Gorka Avatar answered Jan 29 '23 12:01

Gorka