Uploading a Document

As a manufacturer, you must upload documents like images, word files, external documents and so on into SAP Asset Strategy and Performance Management, and then assign them to a model, an item of equipment, an instruction, or an announcement to ensure the business objects have sufficient documentation.

This API allows you to upload a document its language version in formats other than VDS. For example: docx, png, pdf, html, to name a few.

Prerequisite

You have identified the document that you want to upload.

Request

  1. This request is for uploading documents in formats like PDF, text, image, word and so on.

    • HTTP Method: POST using form data.
    • Example URL:Application_URL/services/api/v1/documents
    • Authorization:You must have the roles DOCUMENT_EDIT and DOCUMENT_DELETE assigned to your user IDin the SAP Cloud Platform account.
    • Schema:You must use a form data to upload a new document rather than using a JSON schema. The fields of the form data are described in the table below:
      Parameters used in the Form Data

      Field Name (Mandatory or Optional)

      Data Type

      Description and Possible Values

      file (Mandatory)

      File

      Specifies the file that you want to upload.

      file-data (Mandatory)

      JSON

      phaseCodeSpecifies the phases for which the document is relevant to in the lifecycle of a business object such as a model, an equipment, or a business entity such as an instruction, or an announcement.

      The possible values for the phases are provided in the table Phase Codes and Category Codes.

      categoryCodeSpecifies categorycode that corresponds to a phasecode. For the possible values of categoryCode, see Table Phase Codes and Category Codes.

      descriptionSpecifies the description of the document.

      languageCodeSpecifies the language of the document.The possible values for the phase are provided in the table Language Codes.

      fileNameSpecifies the name of the file.

      confidentiality specifies if the document is visible to everyone or is only for internal use.

  2. This request is used upload link documents.

Response

The system generates a unique document ID after the successful execution of the service. For more information on the response schema and the corresponding status codes, see RAML definitions at https://help.sap.com/doc/c8af652c31a6435baf13e424539276d4/1902/en-US/documents.html#documents_post.