Add an API Schema to the Unified Schema

When you add an API, Anypoint DataGraph generates an API schema from that API’s specification, which you can then edit before adding it to the unified schema.

Note that some elements in your API specification, such as non-GET operations, are not added to the API schema. See Errors When Generating the API Schema for more information.

Adding an API to the unified schema comprises three tasks:

  1. Add the API to Anypoint DataGraph.

  2. Preview the generated API schema.

  3. Edit the API schema and resolve any conflicts.

You must resolve any conflicts between object types before adding the generated API schema to the unified schema. Refer to Resolve Conflicts for more information.

Prerequisites

To add an API to the unified schema, ensure you have:

  • Created a REST API using either a RAML or OAS specification.

  • Published the API in Exchange in the same organization as your unified schema.

  • Initiated an instance of the API with an accessible URL.

The API does not need to be a Mule application or be running on Mule runtime engine or in CloudHub.

Additionally you must:

  • Have the correct permissions to add APIs.

  • Ensure that the business group or organization using Anypoint DataGraph has the correct number of vCores allocated, as specified in your plan. If you haven’t allocated the correct number of vCores to the environment in which you’re attempting to add an API, Anypoint DataGraph raises an error message.

Add the API to Anypoint DataGraph

The first task to adding an API to the unified schema is adding the API to Anypoint DataGraph by configuring its asset version, URL, and authentication method.

  • Supported authentication methods to access your API from Anypoint DataGraph are listed in the following procedure. Any other authentication methods, such as custom OAuth implementations or short-lived token methods, are not supported. See Supported Authentication Methods for more information.

  • After you add an API to Anypoint DataGraph, you can’t change its URL. To change an API’s URL, remove the API and re-add it. You can, however, edit an API’s authentication method at any time.

  1. From Anypoint Platform > Anypoint DataGraph, select the appropriate environment from the Unified Data Graph dropdown list, and click +Add API.

  2. On the Select API page, select the API that you want to add.

  3. Click Next: Configure URL.

  4. On the Configure URL page, select the API version and asset version of the API you want to add, and then select Confirm Selection.

  5. Still on the Configure URL page, add or edit the API’s URL:

    • If your API is managed by API Manager or if you have added the API’s instances in Exchange, select Get an existing URL from Anypoint Platform.

    • If you prefer to manually provide your own implementation URL, select Add a new URL.

  6. Click Next: Provide authentication.

  7. On the Provide authentication page, select the type of authentication on the GET endpoints for the API that you are adding:

    • No Auth: Use if your API is public.

    • Basic Auth: Use if you authenticate to your API using a username and password.

    • Client ID enforcement via headers: Use if you authenticate to your API passing client_id and client_secret headers.

    • Client ID enforcement via query parameters: Use if you authenticate to your API passing client_id and client_secret query params.

    • Custom: Use if you authenticate to your API using custom header parameters and values.

  8. Click Next: Preview Schema.

Preview the Generated API Schema

After you add the API to it, Anypoint DataGraph automatically translates the API’s specification to its corresponding API schema, which you next preview before editing the schema and resolving conflicts, if any occur:

  1. On the Preview Schema page, review the types and fields in your API schema.

  2. When you’re done previewing the schema, click Next: Edit Schema.

Edit the API Schema and Add It to the Unified Schema

The final task in adding an API is to edit the schema to resolve conflicts, if any exist, and to enrich the schema.

  1. If Anypoint DataGraph has raised an error and prompted you to resolve a conflict, resolve it on the Edit Schema page.

    Conflicts raised by Anypoint DataGraph include suggested resolutions in their prompts.

  2. If you want to make the unified schema more robust, edit the API schema (either now or after you add it to the unified schema) to perform the following:

    • Enable collaboration on an object type.

      Enable collaboration for applicable types and provide the required settings. This is optional, but when you enable collaboration on types, you create a more connected and enriched unified schema.

    • Manage visibility of schema elements.

      You can hide the fields, types, or query methods that you don’t want visible in the unified schema.

    • Review and edit names of schema elements.

      You can edit the names of all fields, types, and query methods that you add to the unified schema to make them more relevant for queries.

    • Merge similar object types.

      Merging types enables you to combine similar types to extend their fields and datasets for more enriched query results.

    • Link related fields between object types.

      Linking enables you to join related fields from two types to return a wider range of results when you query the linked types.

  3. Click Next: Add to unified schema.

Anypoint DataGraph updates the unified schema. When the unified schema is updating, you can view the new changes in the schema, make additional changes, and apply new changes. However, these changes aren’t available to query until the update is complete, which can take several minutes.

Edit the URL for an API Added to the Unified Schema

If you need to edit the URL of an API that you’ve added to the unified schema, you can do so on the API details page.

  1. Click List of APIs added and select the API that has the URL you want to edit.

  2. Click API details.

  3. Next to the API url field, click Edit URL.

  4. Type in the new URL.

  5. Click Save.

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub