api/v1/content

The transport content API allows you to work with items available on the Content Network.

This API allows you to do the following:
  • Get items and item details from the Content Network.

  • Move or delete private items on the Content Network.

  • Get or modify item permissions.

  • Create import and export jobs.

  • Get job status.

Prerequisites

You have to pass X-CSRF token, x-sap-sac-custom-auth=true parameter, and the access token to authorize your client application while sending any request to the API.

Follow these steps:

  1. Create a new OAuth client. Follow the steps in the topic Managing OAuth Clients to create a new OAuth client.

  2. Authorize the OAuth client. Follow the steps in the section Authorization for API access OAuth Clients of the topic Managing OAuth Clients to authorize the OAuth client.

  3. Add the X-CSRF token.

    1. Issue a GET request to the API endpoint. Example endpoint: https://<TENANT_URL>/api/v1/csrf

      You must include the following headers with your GET request:
      • Authorization: Bearer <Access_Token>

      • x-sap-sac-custom-auth: true

      • x-csrf-token: fetch

    2. Retrieve the value of the HTTP response header named x-csrf-token.

  4. In an HTTP request that you make to the API, add the following:

    • Authorization: Bearer <Access_Token>

    • x-sap-sac-custom-auth: true

    • x-csrf-token: <x-csrf_Token_Value>

Alternatively, you can also follow the steps for Configuring OAuth 2.0 Authorization Code Grant Workflow in Setting Up Authentication. You would then require x-csrf token if you're sending POST, PATCH, UPDATE, and DELETE requests. You can follow step 3 mentioned above and eliminate the x-sap-sac-custom-auth parameter to generate an x-csrf-token for authorization code grant workflow.

If you choose OAuth 2.0 Authorization Code Grant, then you have to pass the following parameters in your request:
  • Authorization: Bearer <Access_Token>

  • x-csrf-token: <x-csrf_Token_Value>

API Endpoints and Parameters

Private Package

Endpoint

Description

api/v1/content

Get a filtered list of private items.

/jobs

Export or import items from the Content Network.

/jobs/<JobID>

Get the status of an import or export job.

/<itemID>

Delete a private item.

/<itemID>/<targetID>

Move a private item.

/<itemID>/<waveItemID>

Get the details for a specific private item.

/permissions/<itemID>

Get or edit permissions for a private item.

Public Package

Endpoint

Description

/public/<parentItemID>

Get all public items, or a filtered list of items.

/public/<itemID>/<waveItemID>

Get the details for a specific public item.

/public/permissions/<itemID>

Get or modify the permissions for a public item.

Additional Information

Endpoint

Description

Predefined Content Network Package Tags

A list of package tags for private and public packages.

Transport Content Status Codes

A list of status codes returned by the API.

Getting Filtered List of Permitted Items

You can add tags in the request body to filter the list of permitted items.

API Request Details

You would need the following information to get the list of permitted items.

URL

/api/v1/content/

Request Type

POST

Content Type

application/json

Query Parameters

Refer to the table below.

Query Parameters

Name

Description

Type

Default Value

Supported Values

Permissions

List the items that the user has specific permissions for

String

list

The default value is list. The supported values are list, read, write, and delete. Multiple values can be sent using the & operator.

itemType

Specify the type of items to be fetched

String.

ALL

The supported values are:
  • PACKAGE

  • SUB-CATEGORY

  • ALL

tags

Specifies the tag IDs to filter the items

String

Multiple values can be sent using "&" operator.

[]

You can check the supported tags with their IDs in Predefined Content Network Package Tags.