4

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.

Jared Smith
  • 283
  • 4
  • 11
  • I'm really at a loss here, I've been working on their damned API all day long...it's hellishly poorly documented. These two are really holding me up...I've spent several hours on this. – Jared Smith Jul 18 '12 at 22:20

4 Answers4

6

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

Anne Allen
  • 61
  • 1
  • 3
2

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.

Gorka
  • 281
  • 2
  • 4
  • 1
    Yup, account numbers in the deactivate links are not reliable - better to use $account->id – Marty Sep 26 '17 at 23:37
1

Let me tell you how to get $list_id value... login into your AWeber account and then create a new list copy only integer value from list's name.

himanshu
  • 11
  • 1
1

At first, login.

1) click Reports>Settings. Your account ID will be displayed in the box,example: ?id=XXXXX

2) click List Options>List Settings. There you will see the list ID under the name.

p.s. To add subscriber, you can use this - Automatically add into aweber list

Community
  • 1
  • 1
T.Todua
  • 53,146
  • 19
  • 236
  • 237