Facing No 'Access-Control-Allow-Origin' problem while Configuring develpoer portal for Smardocs.

Not applicable

I am trying to use smartDocs for API documenation I have followed the steps mentioned in the doc available for the same. Getting following error whenever I am creating a new model and trying to access the drupal node created after rendering and publishing the model for API :

XMLHttpRequest cannot load https://apiconsolexyz-prod.apigee.net/smartdocs/v1/sendrequest/v1/o/myorg/apimodels/proxyUrl?_=14279... No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://apigee-dev.abc.com' is therefore not allowed access. Could you please help in this.

0 4 1,163
4 REPLIES 4

Not applicable

Apigee Edge and Dev Portal in our cloud is configured automatically by default. It shouldn't require any configuration other than enabling the SmartDocs module in the Dev Portal.

For OPDK installs please refer to SmartDocs documentation here:

http://apigee.com/docs/developer-services/content/using-smartdocs-document-apis

For OPDK installs only, it appears from your question you are using SSL "https".

https://apiconsolexyz-prod.apigee.net/smartdocs/v1/sendrequest/v1/o/myorg/apimodels/proxyUrl?_=14279...

Can you confirm you have SSL configured correctly on Apigee Edge:

253-image1.jpg

OPDK configuration information taken from SmartDocs documentation:

  1. If your portal connects to an OPDK installation of Apigee Edge (ignore this step if your portal connects to a cloud-based version of Edge):
    1. Select SmartDocs > Settings in the Drupal administration menu.
    2. Expand the Advanced Settings area.
    3. Expand the Management API Override Settings area.
    4. Set the Use Management API URL Override checkbox.
    5. Set the Management API URL Override to:

      <a href="https://<strong">https://<strong><em>routerIP:portNumber</em></strong>/management</a>><em>routerIP:portNumber</em></strong>/management

      whererouterIP:portNumber is the IP address and port number of the router for an on-premises Edge OPDK installation. The default router port number is 59002, so the URL is typically in the form <a href="https://<strong">https://<strong>routerIP:59002</strong>/management</a>>routerIP:59002</strong>/management. If your Edge installation has multiple routers connected to a load balancer, specify the IP and port number of the load balancer, not of a router.

    6. Save the configuration.
  2. If your portal connects to an OPDK installation of Apigee Edge, and the IP address of your Management Server is not publicly accessible:
    1. Run the following cURL command from a machine that can access the Management Server:

      curl <a href="http://<strong">http://<strong>managment_server_ip</strong>:8080/v1/o/smartdocs/apimodels/proxyUrl</a>>managment_server_ip</strong>:8080/v1/o/smartdocs/apimodels/proxyUrl

      where <strong>managment_server_ip</strong> is the IP address or your Management Server. The response will be in the form:

      {"authUrl":"https://api.enterprise.apigee.com/v1/users/{user}/authenticate","proxyUrl":"https://apiconsole-prod.apigee.net/smartdocs/v1"}
    2. Copy the URL from the proxyUrl element in the response.>
    3. Select SmartDocs > Settings in the Drupal administration menu.
    4. Expand the Advanced Settings area.
    5. Paste the proxyUrl into Custom Proxy URL.
    6. Save your changes

For OPDK installs only, ensure SmartDocs was installed correctly in edge. You should have an organization called "smartdocs" and two proxies "management" and "smartdocs":

254-photo2.jpg

Thanks fo the prompt reply. We have followed all the steps as mentioned in the smarctDocs documenation http://apigee.com/docs/developer-services/content/using-smartdocs-document-apis

As mentioned in the step no 11; We are using an OPDK installation of Apigee Edge, and the IP address of our Management Server is not publicly accessible. But we are not getting any Custom Proxy field as mentioned in the step no 11 where we can specify the proxy URL. Please refer attached screenshot for the same.

256-settings.png

Not applicable

It appears you're using an older version of SmartDocs "Dev Portal". It is highly recommended you upgrade your Developer Portal to the latest version.

The latest version of Drupal SmartDocs module is "7.x-4.0"

258-image3.jpg

As suggested, we have upgraded smartDocs to 7.x-14.08.13 version. Please refer the screenshot.

Still as specified in point no 11, Custom Proxy URL field option is not avialble under SmartDocs->Settings->Adnavanced Settings 273-smartdocs-v7.png

It would be really helpful if you can share more details with a screenshot for Custom Ptroxy URL field.