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

feat: add support for "Get Contacts by Emails" endpoint #159

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

funder7
Copy link

@funder7 funder7 commented Oct 27, 2023

Fixes

Makes the Get contacts by emails endpoint usable by adding the relative phpDoc method.

Checklist

  • I acknowledge that all my contributions will be made under the project's license
  • I have made a material change to the repo (functionality, testing, spelling, grammar)
  • I have read the Contribution Guidelines and my PR follows them
  • I have titled the PR appropriately
  • I have updated my branch with the main branch
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation about the functionality in the appropriate .md file
  • I have added inline documentation to the code I modified

- Add missing endpoint support
- Fix typos in CONTRIBUTING.md example
@funder7 funder7 changed the title Add support for "Get Contacts by Emails" endpoint feat: add support for "Get Contacts by Emails" endpoint Oct 27, 2023
@funder7
Copy link
Author

funder7 commented Oct 30, 2023

@twilio-dx any news about this PR? Thanks

@tiwarishubham635
Copy link
Contributor

Hi @funder7! We have added this to our list and looking into it. Thanks!

@tiwarishubham635
Copy link
Contributor

Hi @funder7! I just check this one. The endpoint is already accessible if you have your contacts added. It throws 404 when there are no contacts previously added. I firstly created a contact with my sendgrid account with some email id say - [email protected]. Then I executed this script and it wokred for me giving a 200 response and fetched the required contact.

`<?php
// Uncomment next line if you're not using a dependency loader (such as Composer)
// require_once '/sendgrid-php.php';

$apiKey = getenv('SENDGRID_API_KEY');
$sg = new \SendGrid($apiKey);
$request_body = json_decode('{
"emails": [
"[email protected]"
]
}');

try {
$response = $sg->client->marketing()->contacts()->search()->emails()->post($request_body);
print $response->statusCode() . "\n";
print_r($response->headers());
print $response->body() . "\n";
} catch (Exception $ex) {
echo 'Caught exception: '. $ex->getMessage();
}`
So I don't think this change is required. Can you check?

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.

None yet

2 participants