Create a learning content item

post

/hcmRestApi/resources/11.13.18.05/learningContentItems

Request

Header Parameters
  • If the REST API supports runtime customizations, the shape of the service may change during runtime. The REST client may isolate itself from these changes or choose to interact with the latest version of the API by specifying this header. For example: Metadata-Context:sandbox="TrackEmployeeFeature".
  • The protocol version between a REST client and service. If the client does not specify this header in the request the server will pick a default version for the API.
  • Contains one of the following values: true or false. If true, the server performs an Upsert operation instead of a Create operation. During an Upsert operation, the server attempts to find an existing resource that matches the payload. If a match is found, the server updates the existing resource instead of creating a new one. If not found or false (default), the server performs a Create operation. Note that the Upsert operation isn't supported for date-effective REST resources.
Supported Media Types
Request Body - application/json ()
Root Schema : schema
Type: object
Show Source
Back to Top

Response

Supported Media Types

Default Response

The following table describes the default response for this task.
Headers
  • If the REST API supports runtime customizations, the shape of the service may change during runtime. The REST client may isolate itself from these changes or choose to interact with the latest version of the API by specifying this header. For example: Metadata-Context:sandbox="TrackEmployeeFeature".
  • The protocol version between a REST client and service. If the client does not specify this header in the request the server will pick a default version for the API.
Body ()
Root Schema : learningContentItems-item-response
Type: object
Show Source
Back to Top

Examples

The following examples show how to create these learning content items by submitting a POST request on the REST resource using cURL.

  • SCORM learning content
  • Video learning content
  • PDF learning content
  • Web Link learning content

SCORM Learning Content

The following example shows how to create a SCORM learning content item by submitting a POST request on the REST resource using cURL. To create a SCORM learning content item:

  1. Create the metadata for the SCORM content item. (POST)
  2. Upload the SCORM package file to Oracle Learning Cloud. (POST)
  3. Initiate the SCORM zip file ingestion into Oracle Learning Cloud. (PATCH)

Creating the Metadata

Example of cURL Command

The following is an example of the cURL command.

curl -vs -u '<username>:<password>' -H 'Content-Type: application/vnd.oracle.adf.resourceitem+json' -d "@WebContentPayload.txt"  https://<host>:<port>/hcmRestApi/resources/11.13.18.05/learningContentItems &> NewWebContentDetails.out

Example of Payload

The following is an example of the payload.

{
  "Title" : "REST: SS 201710081350 Jefferson",
  "FileName" : "JefferSonSCORM12.zip",
  "Description" : "REST: SS 201710081350 Jefferson Desc",
  "ItemNumber" : "REST-201710081350-SCORM",
  "TrackingType" : "ORA_SCORM_12",
  "StartDate" : "2017-06-15",
  "EndDate" : "2018-06-14"
}

Example of Response Header

The following is an example of the response header.

Status: HTTP/1.1 201 Created
Content-Type: application/vnd.oracle.adf.resourceitem+json

Example of Response Body

The following example shows the contents of the response body in JSON format.

{
  "ContentId" : 300100101142985,
  "Title" : "REST: SS 201710081350 Jefferson",
  "FileName" : "JefferSonSCORM12.zip", 
  "ItemNumber" : "REST-201710081350-SCORM",
  "TrackingType" : "ORA_SCORM_12",
  "Description" : "REST: SS 201710081350 Jefferson Desc",
  "StartDate" : "2017-06-15",
  "EndDate" : "2018-06-14",
  "UUID" : "92cfc80e-953b-449c-90a6-18afa401628f",
  "Status" : "ORA_CONT_INACTIVE",
  "URL" : null,
  "AuthToken" : "X-Akamai-ACS-Action:action=upload&version=1&index-zip=1||X-Akamai-ACS-Auth-Data:5, 0.0.0.0, 0.0.0.0, 1507582333, 457024713, Oraclemedia||X-Akamai-ACS-Auth-Sign:7cQB5HotJLxYBh6X4o0mO3Dma47UGZ1TPG9xLMWUiz0=",
 "Location" : "scorm/FA.HCM.PER.HcmEngmtVideoShare-92cfc80e-953b-449c-90a6-18afa401628f_private/92cfc80e-953b-449c-90a6-18afa401628f.zip",
  "IngestionStatus" : "ORA_MED_NEW",
  "Operation" : null,
		"links":[8]
         0:  {...
            ...}
}

Uploading the SCORM File

Example of cURL Command

The following is an example of the cURL command.

curl -vs 'https://oraclemedia-nsu.akamaihd.net/335633/scorm/FA.HCM.PER.HcmEngmtVideoShare-<UUID>_private/<UUID>.zip'
-H 'X-Akamai-ACS-Action: action=upload&version=1&index-zip=1' 
-H 'X-Akamai-ACS-Auth-Data:<Auth_Data_From_Create_CONTENT_Metadata_response>'
-H 'X-Akamai-ACS-Auth-Sign:<Auth_Sign_From_Create_CONTENT_Metadata_response>'
-X POST --upload-file<SCORM_zip_File>&>UploadWebContentFile.out

Example of Payload

SCORM .zip file

Example of Response Header

The following is an example of the response header.

Status: HTTP/1.1 200 OK

Example of Response Body

The following example shows the contents of the response body.

Accept: */*
> X-Akamai-ACS-Action: action=upload&version=1&index-zip=1
> X-Akamai-ACS-Auth-Data:5, 0.0.0.0, 0.0.0.0, 1507582333, 457024713, Oraclemedia
> X-Akamai-ACS-Auth-Sign:7cQB5HotJLxYBh6X4o0mO3Dma47UGZ1TPG9xLMWUiz0=
> Content-Length: 457453
> Expect: 100-continue
> 
< HTTP/1.1 100 Continue
< Expires: Mon, 09 Oct 2017 20:52:28 GMT
< Cache-Control: max-age=0, no-cache, no-store
< Pragma: no-cache
} [16384 bytes data]
* We are completely uploaded and fine
< HTTP/1.1 200 OK
< Server: Apache
< Content-Type: text/html
< Expires: Mon, 09 Oct 2017 20:52:28 GMT
< Cache-Control: max-age=0, no-cache, no-store
< Pragma: no-cache
< Date: Mon, 09 Oct 2017 20:52:28 GMT
< Content-Length: 31
< Connection: keep-alive

Initiating SCORM File Ingestion

Example of cURL Command

The following is an example of the cURL command.

curl -vs -u '<username>:<password>' -H 'Content-Type: application/vnd.oracle.adf.resourceitem+json' -d "@WebContentPayloadForUpdate.txt" -X PATCH  https://<host>:<port>/hcmRestApi/resources/11.13.18.05/learningContentItems/<CONTENT_ID> &> UpdateWebContentFile.out

Example of Payload

The following is an example of the payload.

{
  "Title" : "REST: SS 201710081350 Jefferson",
  "Description" : "REST: SS 201710081350 Jefferson Desc",
  "StartDate" : "2017-06-15",
  "EndDate" : "2018-06-14"
}

Example of Response Header

The following is an example of the response header.

Status: HTTP/1.1 200 OK
Content-Type: application/vnd.oracle.adf.resourceitem+json

Example of Response Body

The following example shows the contents of the response body in JSON format.

{
  "ContentId" : 300100101142985,
  "Title" : "REST: SS 201710081350 Jefferson",
  "FileName" : null,
  "ItemNumber" : "REST-201710081350-SCORM",
  "TrackingType" : "ORA_UNKNOWN",
  "Description" : "REST: SS 201710081350 Jefferson Desc",
  "StartDate" : "2017-06-15",
  "EndDate" : "2018-06-14",
  "UUID" : "92cfc80e-953b-449c-90a6-18afa401628f",
  "Status" : "ORA_CONT_INACTIVE",
  "URL" : null,
  "AuthToken" : null,
  "Location" : "scorm/FA.HCM.PER.HcmEngmtVideoShare-92cfc80e-953b-449c-90a6-18afa401628f_private/92cfc80e-953b-449c-90a6-18afa401628f.zip",
  "IngestionStatus" : "ORA_MED_TRANSCODING",
  "Operation" :"",
    		"links":[8]
         	0:  {...
            ...}
}

Video Learning Content

The following example shows how to create a video learning content item by submitting a POST request on the REST resource using cURL. To create a video learning content item:

  1. Create the metadata for the video content item. (POST)
  2. Upload the video file to Oracle Learning Cloud. (POST)
  3. Initiate the video file ingestion into Oracle Learning Cloud. (PATCH)

Creating the Metadata

Example of cURL Command

The following is an example of the cURL command.

curl -vs -u '<username>:<password>' -H 'Content-Type: application/vnd.oracle.adf.resourceitem+json' -d "@VideoContentPayload.txt"  https://<host>:<port>/hcmRestApi/resources/11.13.18.05/learningContentItems &> NewVideoContentDetails.out

Example of Payload

The following is an example of the payload.

{
  "Title" : "REST: SS 201710091906 video_4_secs",
  "FileName" : "video_4_secs.mov",
  "Description" : "REST: SS 201710091906 video_4_secs Desc",
  "ItemNumber" : "REST-201710091906",
  "TrackingType" : "ORA_CONTENT_VIDEO",
  "StartDate" : "2017-06-15",
  "EndDate" : "2018-06-14"
}

Example of Response Header

The following is an example of the response header.

Status: HTTP/1.1 201 Created
Content-Type: application/vnd.oracle.adf.resourceitem+json

Example of Response Body

The following example shows the contents of the response body in JSON format.

{
  "ContentId" : 300100101257750,
  "Title" : "REST: SS 201710091906 video_4_secs",
  "FileName" : "video_4_secs.mov",
  "ItemNumber" : "REST-201710091906",
  "TrackingType" : "ORA_CONTENT_VIDEO",
  "Description" : "REST: SS 201710091906 video_4_secs Desc",
  "StartDate" : "2017-06-15",
  "EndDate" : "2018-06-14",
  "UUID" : "e778388a-15f8-4261-9338-d3b702aa8323",
  "Status" : "ORA_CONT_INACTIVE",
  "URL" : null,
  "AuthToken" : "X-Akamai-ACS-Action:action=upload&version=1||X-Akamai-ACS-Auth-Data:5, 0.0.0.0	, 	0.0.0.0, 1507601292, 604982616, Oraclemedia||X-Akamai-ACS-Auth-Sign:ktzX85LZYJvFYJbJ6pnSOoY8xBr9EynBw0B8hFg1+aE=",
	"Location" : "src/FA.HCM.PER.HcmEngmtVideoShare-e778388a-15f8-4261-9338-d3b702aa8323_private	/	e778388a-15f8-4261-9338-d3b702aa8323.mov",
  "IngestionStatus" : "ORA_MED_NEW",
  "Operation" : null,
			"links":[8]
         	0:  {...
           	 ...}
}

Uploading the Video File

Example of cURL Command

The following is an example of the cURL command.

curl -vs 'https://oraclemedia-nsu.akamaihd.net/335633/scorm/FA.HCM.PER.HcmEngmtVideoShare-<UUID>_private/<UUID>.zip'
-H 'X-Akamai-ACS-Action: action=upload&version=1&index-zip=1' 
-H 'X-Akamai-ACS-Auth-Data:<Auth_Data_From_Create_CONTENT_Metadata_response>'
-H 'X-Akamai-ACS-Auth-Sign:<Auth_Sign_From_Create_CONTENT_Metadata_response>'
-X POST --upload-file<Video_File> &> UploadVideoContentFile.out

Example of Payload

Video file

Example of Response Header

The following is an example of the response header.

Status: HTTP/1.1 200 OK

Example of Response Body

The following example shows the contents of the response body.

> Accept: */*
> X-Akamai-ACS-Action: action=upload&version=1
> X-Akamai-ACS-Auth-Data:5, 0.0.0.0, 0.0.0.0, 1507601292, 604982616, Oraclemedia
> X-Akamai-ACS-Auth-Sign:ktzX85LZYJvFYJbJ6pnSOoY8xBr9EynBw0B8hFg1+aE=
> Content-Length: 1603769
> Expect: 100-continue
> 
< HTTP/1.1 100 Continue
< Expires: Tue, 10 Oct 2017 02:08:33 GMT
< Cache-Control: max-age=0, no-cache, no-store
< Pragma: no-cache
} [16384 bytes data]
* We are completely uploaded and fine
< HTTP/1.1 200 OK
< Server: Apache
< Content-Type: text/html
< Expires: Tue, 10 Oct 2017 02:08:36 GMT
< Cache-Control: max-age=0, no-cache, no-store
< Pragma: no-cache
< Date: Tue, 10 Oct 2017 02:08:36 GMT
< Content-Length: 31
< Connection: keep-alive
< 
{ [31 bytes data]
* Connection #0 to host oraclemedia-nsu.akamaihd.net left intact<HTML>Request Processed</HTML>

Initiating Video File Ingestion

Example of cURL Command

The following is an example of the cURL command.

curl -vs -u '<username>:<password>' -H 'Content-Type: application/vnd.oracle.adf.resourceitem+json' -d "@VideoContentPayloadForUpdate.txt" -X PATCH  https://<host>:<port>/hcmRestApi/resources/11.13.18.05/learningContentItems/<CONTENT_ID> &> UpdateVideoContentFile.out

Example of Payload

The following is an example of the payload.

{
  "IngestionStatus" : "ORA_MED_TRANSCODING"
}

Example of Response Header

The following is an example of the response header.

Status: HTTP/1.1 200 OK
Content-Type: application/vnd.oracle.adf.resourceitem+json

Example of Response Body

The following example shows the contents of the response body in JSON format.

{
  "ContentId" : 300100101257750,
  "Title" : "REST: SS 201710091906 video_4_secs",
  "FileName" : "video_4_secs.mov",
  "ItemNumber" : "REST-201710091906",
  "TrackingType" : "ORA_CONTENT_VIDEO",
  "Description" : "REST: SS 201710091906 video_4_secs Desc",
  "StartDate" : "2017-06-15",
  "EndDate" : "2018-06-14",
  "UUID" : "e778388a-15f8-4261-9338-d3b702aa8323",
  "Status" : "ORA_CONT_INACTIVE",
  "URL" : null,
  "AuthToken" : null,
  "Location" : "src/FA.HCM.PER.HcmEngmtVideoShare-e778388a-15f8-4261-9338-d3b702aa8323_private/e778388a-15f8-4261-9338-d3b702aa8323.mov",
  "IngestionStatus" : "ORA_MED_TRANSCODING",
  "Operation" : "",
		 "links":[8]
         	0:  {...
           	 ...}
}

PDF Learning Content

The following example shows how to create a PDF learning content item by submitting a POST request on the REST resource using cURL. To create a PDF learning content item:

  1. Create the metadata for the PDF content item. (POST)
  2. Upload the PDF file to Oracle Learning Cloud. (POST)

Creating the Metadata

Example of cURL Command

The following is an example of the cURL command.

curl -vs -u '<username>:<password>' -H 'Content-Type: application/vnd.oracle.adf.resourceitem+json' -d "@PDFContentPayload.txt"  https://<host>:<port>/hcmRestApi/resources/11.13.18.05/learningContentItems &> NewPDFContentDetails.out

Example of Payload

The following is an example of the payload.

{
  "Title" : "REST: SS 201710091949 TLearn",
  "FileName" : "TLearn.pdf",
  "Description" : "REST: SS 201710091949 TLearn Desc",
  "ItemNumber" : "REST-201710091949-PDF",
  "TrackingType" : "ORA_PDF",
  "Status" : "ORA_CONT_ACTIVE",
  "StartDate" : "2017-06-15",
  "EndDate" : "2018-06-14"
}

Example of Response Header

The following is an example of the response header.

Status: HTTP/1.1 201 Created
Content-Type: application/vnd.oracle.adf.resourceitem+json

Example of Response Body

The following example shows the contents of the response body in JSON format.

{
  "ContentId" : 300100101257756,
  "Title" : "REST: SS 201710091949 TLearn",
  "FileName" : "TLearn.pdf",
  "ItemNumber" : "REST-201710091949-PDF",
  "TrackingType" : "ORA_PDF",
  "Description" : "REST: SS 201710091949 video_4_secs Desc",
  "StartDate" : "2017-06-15",
  "EndDate" : "2018-06-14",
  "UUID" : "60c5e47d-bc50-44c0-b6ed-736508eb73e8",
  "Status" : "ORA_CONT_ACTIVE",
  "URL" : null,
  "AuthToken" : "X-Akamai-ACS-Action:action=upload&version=1||X-Akamai-ACS-Auth-Data:5, 0.0.0.0, 0.0.0.0, 1507604022, 2097491649, Oraclemedia||X-Akamai-ACS-Auth-Sign:6szYsIlcztab31lygNDWghM4pj/IVqBEG7JqTxaYQmg=",
  "Location" : "scorm/FA.HCM.PER.HcmEngmtVideoShare-60c5e47d-bc50-44c0-b6ed-736508eb73e8_private/60c5e47d-bc50-44c0-b6ed-736508eb73e8.pdf",
  "IngestionStatus" : null,
  "Operation" : null,
		 "links":[8]
         	0:  {...
           	 ...}
}

Uploading the PDF File

Example of cURL Command

The following is an example of the cURL command.

curl -vs 'https://oraclemedia-nsu.akamaihd.net/335633/scorm/FA.HCM.PER.HcmEngmtVideoShare-<UUID>_private/<UUID>.zip'
-H 'X-Akamai-ACS-Action: action=upload&version=1&index-zip=1' 
-H 'X-Akamai-ACS-Auth-Data:<Auth_Data_From_Create_CONTENT_Metadata_response>'
-H 'X-Akamai-ACS-Auth-Sign:<Auth_Sign_From_Create_CONTENT_Metadata_response>'
-X POST --upload-file<PDF_File> &> UploadPDFContentFile.out

Example of Payload

PDF file

Example of Response Header

The following is an example of the response header.

Status: HTTP/1.1 200 OK

Example of Response Body

The following example shows the contents of the response body.

> Accept: */*
> X-Akamai-ACS-Action: action=upload&version=1
> X-Akamai-ACS-Auth-Data:5, 0.0.0.0, 0.0.0.0, 1507604022, 2097491649, Oraclemedia
> X-Akamai-ACS-Auth-Sign:6szYsIlcztab31lygNDWghM4pj/IVqBEG7JqTxaYQmg=
> Content-Length: 2795
> Expect: 100-continue
> 
< HTTP/1.1 100 Continue
< Expires: Tue, 10 Oct 2017 02:54:03 GMT
< Cache-Control: max-age=0, no-cache, no-store
< Pragma: no-cache
} [2795 bytes data]
* We are completely uploaded and fine
< HTTP/1.1 200 OK
< Server: Apache
< Content-Type: text/html
< Expires: Tue, 10 Oct 2017 02:54:03 GMT
< Cache-Control: max-age=0, no-cache, no-store
< Pragma: no-cache
< Date: Tue, 10 Oct 2017 02:54:03 GMT
< Content-Length: 31
< Connection: keep-alive
< 
{ [31 bytes data]
* Connection #0 to host oraclemedia-nsu.akamaihd.net left intact<HTML>Request ProcessedRequest Processed</HTML>

Web Links Content

The following example shows how to create a web links learning content item by submitting a POST request on the REST resource using cURL.

curl -vs -u '<username>:<password>' -H 'Content-Type: application/vnd.oracle.adf.resourceitem+json' -d "@WebLinkContentPayload.txt"  https://<host>:<port>/hcmRestApi/resources/11.13.18.05/learningContentItems &> NewWebLinkContentDetails.out

Example of Payload

The following is an example of the payload.

{
  "Title" : "REST: SS 201710092052 WebLink leadership-skills",
  "Description" : "REST: SS 201710092052 WebLink leadership-skills Desc",
  "ItemNumber" : "REST-201710092052-WebLink",
  "TrackingType" : "ORA_AUTO",
  "URL" : "https://www.coursera.org/learn/leadership-skills",
  "Status" : "ORA_CONT_ACTIVE",
  "StartDate" : "2017-06-15",
  "EndDate" : "2018-06-14"
}

Example of Response Header

The following is an example of the response header.

Status: HTTP/1.1 201 Created
Content-Type: application/vnd.oracle.adf.resourceitem+json

Example of Response Body

The following example shows the contents of the response body in JSON format.

{
  "ContentId" : 300100101257996,
  "Title" : "REST: SS 201710092052 WebLink leadership-skills",
  "FileName" : null,
  "ItemNumber" : "REST-201710092052-WebLink",
  "TrackingType" : "ORA_AUTO",
  "Description" : "REST: SS 201710092052 WebLink leadership-skills Desc",
  "StartDate" : "2017-06-15",
  "EndDate" : "2018-06-14",
  "UUID" : "5fec638b-7a52-43af-a322-49f21cc5f81c",
  "Status" : "ORA_CONT_ACTIVE",
  "URL" : "https://www.coursera.org/learn/leadership-skills",
  "AuthToken" : null,
  "Location" : null,
  "IngestionStatus" : null,
  "Operation" : null,
		 "links":[8]
         	0:  {...
           	 ...}
}
Back to Top