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

Can't look up contact by msisdn #123

Closed
joelzerner opened this issue Jun 9, 2020 · 1 comment
Closed

Can't look up contact by msisdn #123

joelzerner opened this issue Jun 9, 2020 · 1 comment

Comments

@joelzerner
Copy link

Although the MessageBird docs state it is possible to read a contact using the msisdn instead of the contact ID, I've been unable to achieve this using this PHP api. It won't allow me to input a number with a '+' symbol in it and returns an unspecified error.

For API Reference, see: https://developers.messagebird.com/api/contacts/#view-a-contact

Also see this issue on the nodejs wrapper: messagebird/messagebird-nodejs#32

@modprobe
Copy link
Contributor

modprobe commented Jun 9, 2020

Hi @joelzerner! Thanks for flagging this.

Unfortunately, it turns out that the documentation is actually confusing/mixed up here. It is not possible to fetch a single contact by MSISDN, as the MSISDN doesn't have to be unique for your contacts.

It is however possible to search for contacts by MSISDN. You can use the following code to do so:

$client = new \MessageBird\Client('YOUR_ACCESS_KEY');
$contacts = $client->contacts->getList(['msisdn' => 61412345678]);

var_dump($contacts->items);

Please make sure to format your MSISDN as digits only.

I will flag the issue with the documentation internally and we will make sure to clear it up!

@modprobe modprobe closed this as completed Jun 9, 2020
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

No branches or pull requests

2 participants