SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Use Machine Learning to Extract Information from Documents with Swagger UI

Get machine learning model predictions for the documents you upload to SAP Document AI.

Overview

🎓 beginner 15 min. Machine LearningBeginnerArtificial IntelligenceCloudSAP Business Technology PlatformSAP Ai ServicesSAP Document AiFree Tier

You will learn

  • โœ”How to call and test SAP Document AI
  • โœ”How to access and use Swagger UI (User Interface)
  • โœ”How to extract information from files with SAP Document AI

Prerequisites

Steps

Intro

The core functionality of SAP Document AI is to automatically extract structured information from documents using machine learning. When you finish this tutorial, you will get field value predictions for the documents you upload to SAP Document AI.


Step 1 Access and authorize Swagger UI
โ€”

You’ll use Swagger UI, via any web browser, to call the SAP Document AI APIs. Swagger UI allows developers to effortlessly interact and try out every single operation an API exposes for easy consumption. For more information, see Swagger UI.

You need the service key that you created for SAP Document AI in the previous tutorial โ€“ either Use Trial to Create a Service Instance for SAP Document AI or Use Free Tier to Create a Service Instance for SAP Document AI. Outside the uaa section of the service key, you’ll find an entry called tenantuiurl and another called swagger (highlighted in the image below).

  1. To access the SAP Document AI Swagger UI, first copy the tenantuiurl value and paste it into a text editor. Then, copy the swagger value and paste it onto the end of the tenantuiurl value. Finally, copy the resulting string, paste it into the address bar of your web browser, and press Enter.

    DOX
    DOX

  2. To be able to use the Swagger UI endpoints, you need to authorize yourself. In the top right corner, click Authorize.

    DOX
    DOX

  3. Get the access_token value created in the previous tutorial Get OAuth Access Token for SAP Document AI Using Any Web Browser, then add Bearer in front of it, and enter in the Value field.

    Code
    Bearer <access_token>

    DOX
    DOX

  4. Click Authorize, and then click Close.

    DOX
    DOX

Step 2 See list of document fields you can extract
+
Step 3 Get client
+
Step 4 Delete client
+
Step 5 Create client
+
Step 6 Upload document
+
Step 7 See extracted fields
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 7
1. Access and authorize Swagger UI 2. See list of document fields you can extract 3. Get client 4. Delete client 5. Create client 6. Upload document 7. See extracted fields

Learn more →