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

Add params to Retrieve call #92

Open
aetikon opened this issue Oct 16, 2024 · 3 comments
Open

Add params to Retrieve call #92

aetikon opened this issue Oct 16, 2024 · 3 comments

Comments

@aetikon
Copy link

aetikon commented Oct 16, 2024

I'm attempting to retrieve the caller-name and carrier types from a NumberLookup but those properties are always returned as null.

I'm using the following code:

\Telnyx\NumberLookup::Retrieve($number, ["type" => ["caller-name", "carrier"]]);

but it appears that ?type=carrier&type=caller-name isn't appended to the request URL.

Is there a fix for this or do I need to just use cURL?

@weroh
Copy link
Contributor

weroh commented Oct 16, 2024

I can't remember if the library will implode arrays. The lib might be ignoring that param.

Before you switch to cURL, try just using a string instead of an array.

\Telnyx\NumberLookup::Retrieve($number, ["type" => "caller-name,carrier"]);

@weroh
Copy link
Contributor

weroh commented Oct 16, 2024

Sorry I just realized this endpoint needs two type parameters. This is how I have it setup in my test code from several years back:

\Telnyx\NumberLookup::Retrieve($number, ["type" => "caller-name", "type" => "carrier"]);

@aetikon
Copy link
Author

aetikon commented Oct 17, 2024

You're suggesting using a duplicate array key?

In any case, that code doesn't work in v2.9.0 nor 3.0.0.

The caller_name property is still null even when only using the following:

\Telnyx\NumberLookup::Retrieve($number, ["type" => "caller-name"]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants