Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ECI-420] Use Bearer authorization for requests #31

Merged
merged 12 commits into from
May 15, 2020

Conversation

tiannaavery
Copy link
Contributor

@tiannaavery tiannaavery commented May 12, 2020

Closes #25

Fulfills request to use Bearer authorization. I successfully tested this locally.

Currently, the way the documentation says an access token can be used is not valid. The new API definition is as follows.

$client = new \Drip\Client(["account_id" => "YOUR_ACCOUNT_ID", "access_token" => "YOUR_ACCESS_TOKEN"]);
$client = new \Drip\Client(["account_id" => "YOUR_ACCOUNT_ID", "api_key" => "YOUR_API_KEY"]);

The intention is to continue to support the previous client definition and maybe remove it eventually.

$client = new \Drip\Client("YOUR_API_KEY", "YOUR_ACCOUNT_ID");

I also changed references in the code from "api token" to "api key" just for clarity and consistency.

Very open for suggestions on how this could be cleaned up or made better.

@tiannaavery tiannaavery self-assigned this May 12, 2020
@tiannaavery tiannaavery force-pushed the eci-420-bearer-auth branch from 941ca49 to 96b1520 Compare May 12, 2020 17:08
@tiannaavery tiannaavery requested review from will-in-wi, atongen, iantance and a team May 14, 2020 22:46
Copy link
Member

@atongen atongen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

@will-in-wi will-in-wi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great!

@tiannaavery tiannaavery merged commit e45ef05 into master May 15, 2020
@tiannaavery tiannaavery deleted the eci-420-bearer-auth branch May 15, 2020 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is there a reason the Bearer authorization header is not used?
3 participants