Extracting value from apigee edge and reflecting it on dev portal

Not applicable

I want to extract one variable from apigee edge which is comming in response of the proxy and wanted to use the same variable in developer portal.

Is there any way to do this except using smartdocs module.

0 3 157
3 REPLIES 3

@Minakshi Wadibhsme , Welcome to Apigee Community !

Can you please add more context to it why do you want to do that ? Who will be calling that API ? What do you want to do with that variable in Developer Portal once you get it ?

Our requirement is , we are making a call to apigee proxy through developer portal, and we want to get the response on the same page from where we requested.

For Ex. I have one button on my page in developer portal, On clicking of that button the request will go to proxy on apigee edge. Now we want the response of that proxy should get back on developer portal only on the same page where the button is present.

@Minakshi Wadibhsme ,

Yes, It's possible. You need to know Drupal custom module development for same. For example, You can make an API call using drupal_http_request method in Drupal.

For example, Take a look at code below,

// read the payload from a form field value
$payload = $form_state['values']['sample_soap_payload'];
// construct the request
$options = array(
    'method' => 'POST',
    'data' => $payload,
    'timeout' => 30,
    'headers' => array('Content-Type' => 'application/xml', 'SOAPAction' => 'xxx'),
);

$result = drupal_http_request('https://xxxx.apigee.net/v1/xxxx', $options);
// unset existing value
unset($form_state['input']['parameters']['referenceNumberRequest']['referenceNumber']);
// Use the result & set form params
$form['parameters']['referenceNumberRequest']['referenceNumber']['#description'] = "<pre>" . print_r($result, 1) . "</pre>";

Hope it helps. Keep us posted if any.