Issue related to accessing Apigee Edge API through PHP-CURL

Hi,

We have created api proxy by name "API CALLS" in apigee edge portal and able to see the custom reports.

We are trying to access this api proxy "API CALLS" from drupal portal through custom module api by using PHP-CURL.

Below is sampe PHP-CURL code:

$output = shell_exec('curl -X POST -H "https://api.enterprise.apigee.com/v1/o/koolamitks05-eval/e/prod/stats/helloworld?select=sum(app_count)&timeRange=1/1/2018%2000:00~11/15/2019%2000:00&timeUnit=day" -u koolamitks05@gmail.com:P@ssw0rd12');

print_r($output);

But, we are not able to get the output.

Please help!!

Regards,

Parveez

0 6 245
6 REPLIES 6

What do you see in the response? Any error? Any message?

We are not getting any output..

Below is the php line of code:

$output = shell_exec('curl -X POST -H "https://api.enterprise.apigee.com/v1/o/koolamitks05-eval/e/prod/stats/helloworld?select=sum(app_coun..." -u ');

Wait, this is PHP code? Don't shell_exec, PHP has built-in curl functions to use, see https://www.php.net/curl with some usage examples.

If this is a Drupal 7 site, you can also use the simpler drupal_http_request() function.

Hello Siddhartha,

In case if you want to execute the curl command I will provide the credentials to your email-id if required.

I don't recommend you sending me the credentials.

Instead give the complete curl command you are trying by masking the credentials.

Is the url ssl enabled??