/jobs

You can create an export or an import job in the Content Network through an API.

API Request Details

You must enter the following information to create a job.

URL

/api/v1/content/jobs

Request Type

POST

Content Type

application/json

Create an Export Job

This topic provides information that is required to create an export job of private packages in the Content Network through an API.

Context

Once you have the API request details, you have to provide the HTTP body and the service parameters for the request. You can check the sample HTTP body and service parameter structure below and replace the placeholders with actual values.

Attributes in Export Job Request Payload

Attribute

Type

Mandatory/Optional

Description

type

String

Mandatory

Specifies the type of the job. The value should be EXPORT for creating an export job.

serviceParameters

String

Mandatory

  • fields (Mandatory) - contains the name, summary, and description of the export (package). It's an array of fields. Each field specifies different field (for example, name, summary, and description) of the package and it consists of the following: It is a JSON structure that supports only string values and defines the details of the export that includes:

    • fieldTypeIt is a JSON structure that supports only string values (Mandatory) - Specifies the type of the field. It can be name, description, or summary.

    • fieldI18n (Mandatory) - Specifies the localized value of the field. It's an array of object where each object consists of the following:

      • langCode (Mandatory) - The language for the value of the field.

      • value (Mandatory) - The value of the field.

  • isPrivate (Mandatory) - specifies whether the export job is for private content sharing. It should be true as only private Content sharing is supported for this endpoint.

  • privateItemsData (Mandatory) - specifies the following details:

    • itemId (Optional) - specifies the item ID for the existing item when updating it with the modified content/metadata.

    • parentItemId (Mandatory) - specifies the id of the parent folder under which the content is being exported to.

    • permissions (Mandatory) - Specifies the details of who is the recipient of this exported content. Its an array and each object inside it specifies the each sharing entity (permission). If the content need not be shared with anyone or you are using Content Network file to share the content, then you can keep it as empty ([ ]).

      • permission - Specifies a sharing entity and the content can be shared with some tenant by different means.

For sharing the content with a specific tenant use the below attributes:
  • tenantUrl - The tenant url of the tenant the content is being shared.

  • landscapeId - The landscapeId of the tenant the content is being shared.

For sharing the content with a group of tenants having same OEM ID (partner) use the below attributes:
  • oemId - The OEM ID of the tenants.

For sharing the content with a group of tenants having same erpNumber (customer number) use the below attribute:
  • erpNumber -The ERP number of the tenants.

From the above, (tenantUrl&landscapeID/oemId/erpNumber) any one should be present in a sharing entity (permission). The below attributes in permission specifies the access rights that are given for the sharing tenant(s):
  • list (mandatory) - true/false - The tenant should be able to only view the package (export unit)

  • read (mandatory) - true/false - The tenant should be able to view and import the package (export unit)

  • write (mandatory) - true/false - The tenant should be able to view, import, export, and edit the package (export unit)

  • delete (mandatory) - true/false - The tenant should be able to delete the package (export unit).

  • overwritePermissions - true/false - specifies whether the existing permissions require overwriting during the edit export API request.

  • taggingData (optional): Specifies the tags that can be applied for the package.

    taggingData value should be a parameter tag which specifies the tag details. The value of a parameter tag is an array of tag object.

    Each tag object has parameter tagId to specify the tag IDs. You can check the supported tags with their IDs in Predefined Content Network Package Tags.

packageVersion

String

Optional

packageVersion is an optional parameter in the export payload. If not provided, the package is exported with the default version 1.0.0.

originLandscape

String

Conditional

Export inside My Content - originLandscapeId (optional)

Export inside Cross landscape shared folder - originLandscapeId (mandatory), provide source tenant landscape ID.

objects

Object [ ]

Mandatory

Specifies the array of objects to be exported.

Each object has the following attributes:
  • xsParameters: It is required for export job. You should pass no value and leave it empty `{}` .

  • serviceParameters: It includes the parameter includeData which specifies whether the data to be included during export or not. Pass it as below - "{\"includeData\":true}"

  • objectId: Specifies the objectId of the object to be exported.

  • objectName: Specifies the name of the object

  • objectType: Specifies the type of the object.

  • description: Specifies the description of the object.

Response

When the POST method to create an export job is successful, then the system returns the job ID as the response.

Create an Import Job

This topic provides the information that is required to create an import job of private packages in the Content Network through an API.

Attributes in Import Job Request Payload

Import using packageID

Attribute

Type

Mandatory/Optional

Description

type

String

Mandatory

Specifies the type of the Job. The value should be IMPORT for creating an Content Network Import Job.

privatePackage

Long

Mandatory

Specifies the privateItemId/privatePackageId of the package (available in Content Network) to be imported.

publicPackage

Long

Mandatory

publicPackage parameter is required for importing Public Category (Samples, Business Content, 3rd Party Content) Packages.

originLandscape

String

Conditional

Same landscape tenant package - originLandscapeId (optional)

Cross landscape shared package - originLandscapeId (mandaotry), provide source tenant landscape ID.

allObjects

Boolean

Mandatory

Specifies whether all the objects available in the package will be exported or not. Pass always true unless you have the list of objects you want to import.

xsParameters

String

Optional

It's a JSON structure, however, the values are passed as a string. The definition of the options within are as below.

updateExisting: Specifies whether to overwrite objects or data. The default value is true.

importDataOnly: Specifies whether to import and overwrite data of existing objects without making changes to the sturcture of your models. The default value is false.

dropDependent: Specifies whether to drop the dependent objects and import them. The default value is false.

The default value for the xsParameters is -

"{\"updateExisting\" : true, \"importDataOnly\": false, \"dropDependent\": false}".

packageVersion

String

Optional

packageVersion is an optional parameter for importing a package. If not provided, the content of the package with the highest version is imported.

Response

When the POST method to create an import job is successful, then the system returns the job ID as the response. You can go to Transport Content Status Codes to learn about the three-digit code in the response.

Create an Download Job

Attributes in Download Job Request Payload

Attribute

Mandatory/Optional

Description

type

Mandatory

Specifies the type of the job. The value should be DOWNLOAD for creating an download job.

serviceParameters

Mandatory

  • itemId (mandatory) – Package unique ID

  • itemId (mandatory) – Package unique ID

  1. Same landscape tenant package - landscapeId (optional)

  2. Cross landscape shared package - landscapeId (mandaotry), provide source tenant landscape ID.

packageName

Optional

It is recommended to provide this parameter.

packageVersion

Optional

packageVersion is an optional parameter for downloading a package. The highest version of the package is downloaded if packageVersion is not provided.

Create an Upload Job

Attributes in Upload Job Request Payload

Attribute

Mandatory/Optional

Description

type

Mandatory

Specifies the type of the job. The value should be UPLOAD for creating an upload job.

serviceParameters

Mandatory

• parentItemId (mandatory)

  1. To upload package to "My Content", provide null in parentItemID

  2. To upload package inside Folder, provide parentItemID for Folder

• landscapeId (mandatory)

  1. Uploading to Same landscape folder - landscapeId (optional)

  2. Uploading to Cross landscape shared folder - landscapeId (mandaotry), provide source tenant landscape ID.

• replaceExistingItem (optional)

  1. Default value is False

  2. replaceExistingItem – True, when replacing existing package.

packageVersion

Optional

packageVersion is optional parameter for uploading package. If not provided, this will upload the .package with its downloaded version.

If packageVersion provided:
  1. Existing Version and replaceExistingItem=false, then create a duplicate package having same name with prefix. (Ex: PackageName-YYYY/DD/MM_hh:mm:ss)

  2. Existing Version and replaceExistingItem=true, then replace the existing package version.

  3. New Version, replaceExistingItem is not required, then new version of package is created.

Create an Edit Job

This topic provides information that is required to Edit the private packages in the Content Network through an API.

Attributes in Edit Package

Attribute

Mandatory/Optional

Description

itemId

Mandatory

itemId is a mandatory parameter for editing a package.

packageVersion

Optional

packageVersion is an optional parameter for editing a package. If this parameter is not provided, the highest version of the package is automatically selected and a new version is created with an update to the minor version. e.g, if the highest version of the package is 2.0.0, then a new version 2.1.0 is created.

  • If an existing package version is provided for edit, allowReplacePackageVersion=true is mandatory.

  • If a new package version is provided for edit, allowReplacePackageVersion is not required.

Upload to SAP Cloud Transport Management System Job

This topic provides information that is required to upload packages to SAP Cloud Transport Management System in the Content Network through an API

Attributes in Upload to SAP Cloud Transport Management System Job

Attribute

Mandatory/Optional

Description

itemId

Mandatory

itemId is mandatory parameter for uploading the package to SAP Cloud Transport Management System.

packageVersion

Optional

packageVersion is optional parameter. If not provided, this will upload the highest version package to SAP Cloud Transport Management System.

nodeName

Mandatory

nodeName is mandatory, source node created in SAP Cloud Transport Management System Transport route to be provided here