GithubHelp home page GithubHelp logo

aweber / public-api-examples Goto Github PK

View Code? Open in Web Editor NEW
22.0 22.0 42.0 338 KB

Repository containing examples for api.aweber.com

License: BSD 3-Clause "New" or "Revised" License

PHP 17.49% Python 16.75% C# 37.50% JavaScript 18.59% Ruby 9.68%

public-api-examples's People

Contributors

amberheilman avatar cknave avatar dave-shawley avatar dependabot[bot] avatar hlmuludiang avatar kmchappell avatar kpartusch avatar noone234 avatar riatzukiza avatar srelsner avatar vfalco02 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

public-api-examples's Issues

GenericProvider not found.

I keep getting PHP Fatal error: Class 'League\Oauth2\Client\Provider\GenericProvider' not found on line 34. Right after I enter the secret key, it gets fatal error. Cannot find the GenericProvider, although league/oauth2-client is installed via Composer.

Create Subscriber: 400 Bad Request

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 of ws.op parameter.

Secondly, I've tried adding the subscriber using the following code

// add the subscriber if they are not already on the first list
$data = array(
    'email' => $email
);
$body = $client->post($SUBS_URL, [
        'json' => $data, 
        'headers' => ['Authorization' => 'Bearer ' . $accessToken]
    ]);

and got the following error

Fatal error: Uncaught exception 'GuzzleHttp\Exception\ClientException' with message 'Client error: `POST https://api.aweber.com/1.0/accounts/XXXXXX/lists/XXXXXX/subscribers` resulted in a `400 Bad Request` response: {"error": {"status": 400, "documentation_url": "https://labs.aweber.com/docs/troubleshooting#badrequest", "message": "In (truncated...) ' in /var/www/html/aweber/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113 Stack trace: #0 /var/www/html/aweber/vendor/guzzlehttp/guzzle/src/Middleware.php(66): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response)) #1 /var/www/html/aweber/vendor/guzzlehttp/promises/src/Promise.php(203): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response)) #2 /var/www/html/aweber/vendor/guzzlehttp/promises/src/Promise.php(156): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), Array) #3 /var/www/html/aweber/vendor/guzzlehttp/promises/ in /var/www/html/aweber/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 113

Also tried appending the '?ws.op=create' in url but nothing works.

Please help, Thank you!

Code to get access token using refresh token in client-side (javascript)

I am not able to get access token in javascript ..I am using a form and when a user enters the details I need to send that to Aweber using javascript..I got an access token using python script but to refresh the access token I need the code in javascript so that I can use it on the client-side..

API hangs after a few calls to any endpoint

After generating access token and using the get-tags example from this repository the API call usually works a few times in a row, but fourth time or so the call will simply hang... When it does hang it takes about 2 minutes for it to return.

Hopefully someone can fix this because I would like to use this in order to add subscribers to my lists after they sign up to my web app.

Error Getting Credentials

In prompt, everything goes smoothly until I paste the returned URL

"Log in and paste the returned URL here:"

PHP Fatal error: Uncaught League\OAuth2\Client\Provider\Exception\IdentityProviderException: invalid_request in /opt/bitnami/apache/htdocs/vendor/league/oauth2-client/src/Provider/GenericProvider.php:222 Stack trace: #0 /opt/bitnami/apache/htdocs/vendor/league/oauth2-client/src/Provider/AbstractProvider.php(628): League\OAuth2\Client\Provider\GenericProvider->checkResponse() #1 /opt/bitnami/apache/htdocs/vendor/league/oauth2-client/src/Provider/AbstractProvider.php(537): League\OAuth2\Client\Provider\AbstractProvider->getParsedResponse() #2 /opt/bitnami/apache/htdocs/getaccess.php(58): League\OAuth2\Client\Provider\AbstractProvider->getAccessToken() #3 {main} thrown in /opt/bitnami/apache/htdocs/vendor/league/oauth2-client/src/Provider/GenericProvider.php on line 222

giving up.. too damn complicated just to retrieve some already public data

I've spent a few hours to no avail. Can't seem to get a token. I always get "Invalid redirect URI"
created an app with http://localhost:3000/callback as callback url (got client_id, client_secret)
read all the docs everywere
changed everything .. same idiotic error (couldn't maybe just say what the * is wrong with my URI?)
and the thing is.. i just wanted to get something that was public anyway. why this convoluted scheme just to get some data? why not a clean, expressive api just like github has?
sorry for the rant but it's a long time since I've bumped into a clueless error like this one.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.