5G Video Enablement

 

Pre-requisites

Prior to interacting with any of the Alef APIs for the Video Enablement Product, the developer must have completed the following:

  • Creation of an Alef Developer Portal Account
  • Subscription to the Alef Video Enablement Product
  • Configuration of the Alef Video Enablement Product

If there is any confusion as to how to complete these tasks. Please refer to the following document for instruction, https://developer.alefedge.com/get-started/create-edge-native-services/user-guide/ . If these three things have been completed, interaction with Alef Video Enablement APIs can begin. If there is any question as to how to update these Scripts, please view the 5G Video Enablement API Usage Document found here, https://developer.alefedge.com/reference-docs/edgenet-developer-portal/service-usage-docs/api-usage-5g-video-enablement/.

Onboard Private Content

Request
curl --location --request POST 'https://<domain>/api/v1/stream-tech/content/add?partner_name=<partner_name>' \
--header 'Content-Type: application/json' \
--header 'api_key: XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX' \
--data-raw '{
   "urlList": [
       {
           "url": "https://example.com/test/myencoding.m3u8",
           "content_access": "public",
           "publish_access": "private",
           "partner_cloud_url": "https://example.com/test/myencoding.m3u8"
       }
   ]
}'
Response
[
   {
       "message": "Content onboarding is in progress",
       "status": "INPROGRESS",
       "url": "https://example.com/test/myencoding.m3u8",
       "content_id": "bef"
   }

Get All Content

Request
curl --location --request GET 'https://<domain>/api/v1/stream-tech/content/get-all?partner_name=<partner_name>' \
--header 'api_key: XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX'
Response
[
    {
        "id": 13446,
        "partner_name": "60390bec12b7390008c66b0f",
        "content_id": "bdz",
        "content_url": "https://env.alefedge.com/v1/content?url=00c104e612cb7f461e6446d77125a0ed3f839048474bf9305700914f865d122d3f70ba890c64544ea6d97a9261d08cbbcbc3e9088bbe821cca92960b9901a9d7",
        "partner_content_url": "https://example.com/test/myencoding.m3u8",
        "partner_cloud_url": "https://example.com/test/myencoding.m3u8",
        "createdAt": "2021-02-26T15:19:03.000Z",
        "updatedAt": "2021-02-26T15:41:12.000Z",
        "content_upload_status": "success",
        "content_access": "public",
        "publish_access": "private",
        "content_status_message": "Partner Content on-boarded Successfully",
        "partner_content_file_name": "main.m3u8",
        "content_size": 1533202
    }]

Get URL by Content ID

Request
curl --location --request GET 'https://<domain>/api/v1/stream-tech/content/get-url/<content_id>?partner_name=<partner_name>' \
--header 'api_key: XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX'
Response
{
"url": "https://edge.qa-alefedge.com/v1/content?url=00c104e612cb7f461e6446d77125a0edaee10e1f5dd6a712998b0091ba5c25b5ddb942f62544082e32f7e77f5b6408f6bf1f85caf763f405fe422366cb56d142"
}

Get App Key

Request
curl --location --request GET 'https://<domain>/api/v1/stream-tech/get-app-key?partner_name=<partner_name>' \
--header 'api_key: XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX'
Response
{
   "app_keys": [
       "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVyX25hbWUiOiI2MDM5MGJlYzEyYjczOTAwMDhjNjZiMGYiLCJyb2xlIjoicGFydG5lclVzZXIiLCJpYXQiOjE2MTQzNTEzNjYsImV4cCI6MTY0NTkwODk2Nn0.ceMlHNlE1glNkD7E7r5itDsgR1D3ZYPUqvkn_Nxopa0"
   ]
}

Get Signed URL

Request
curl --location --request GET 'https://<domain>/api/v1/stream-tech/signed-url?partner_name=<partner_name>&app_key=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVyX25hbWUiOiI2MDM5MGJlYzEyYjczOTAwMDhjNjZiMGYiLCJyb2xlIjoicGFydG5lclVzZXIiLCJpYXQiOjE2MTQzNTEzNjYsImV4cCI6MTY0NTkwODk2Nn0.ceMlHNlE1glNkD7E7r5itDsgR1D3ZYPUqvkn_Nxopa0&expiry_time=9000&content=https://edge.dev-alefedge.com/v1/content?url=00c104e612cb7f461e6446d77125a0ed3f839048474bf9305700914f865d122dbaf44cd10cd19272845bdd7d399e613ae516aaeee916339b10dd6c5d2a5301ea&allow_signed_cookie=true' \
--header 'api_key: XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX'
Response
{
   "url": "https://env.alefedge.com/v1/content?url=e9ad91a9718a7b60e52723cdde8daf1d01e452a8888dd5178a353f3efdb81f4fee48ce4d128dd1123505d886bda7d3e42295e3dbce819c0b890f163ce22b0b6a1a67d7ec8dc7a406e24d6cc82fe52c7d3f4bdab1a2e89de68cfec0883b86f94b5a22270293f37ebc3ba95bb85f4db48c8df8c4e80f4a8753366f954b589185c31c46a24571c6c5e409aed989ac06cf0572a709b71328424816b7783898867c31db448ec5e035315517a952a2ffc7f9a092392a6b54bb73c5857b6c47d8263bd6dbf43b479e2d2ad781faabb51d4b43623471e1a4a3c74163bde592b1270805e21364d5c61d771fd74ab00f579d2955064778bd5f8eb1e61bb5fb321cf6e76a4249999cd8c8cacac7ec87f018acb47e1d7a6e8acf0fd967b5b6f121b4dabd272c6b145ac07b79bde59c884f44622d055114ccf52b99f6930f5e5b82a55edd8dcfd321c57a0b27118f5730660f6f6fd8cde52b39a3f3c616b40fa886a712bc40dcb30aeb7bb0af790d0e959f947d07e7dc683606fb585f53c18625bcf027d23faa5bec5082eb743f4d69abd809bc57a746261f189cb004ab9acdfbb9133c56c8085c34a4347d37b47cb1d0c2ea30c939f5c2b892fb48e4dd2e1fe6d4be7e7f275e67412d207d4ac2a7c356ff810967e8bf410f6d548bc01fb9b9363ceaa556a299004aeda021d8b3909ac6f0cd91c04c1b2c2761cefff05e68ed89e631a6346ee39da400138244e1620062c95ce3c054ee"
}

Onboard Public Content

Request
curl --location --request POST 'https://<domain>/api/v1/stream-tech/content/add?partner_name=<partner_name>' \
--header 'api_key: XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX' \
--header 'Content-Type: application/json' \
--data-raw '{
  "urlList": [
      {
          "url": "https://example.com/test/myencoding.m3u8",
          "content_access": "public",
          "publish_access": "public",
          "partner_cloud_url": "https://example.com/test/myencoding.m3u8"
      }
  ]
}
'
Response
[
   {
       "message": "Content onboarding is in progress",
       "status": "INPROGRESS",
       "url": "https://example.com/test/myencoding.m3u8",
       "content_id": "beg"
   }
]

Get All Content

Request
curl --location --request GET 'https://<domain>/api/v1/stream-tech/content/get-all?partner_name=<partner_name>' \
--header 'api_key: XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX' \
--data-raw ''
Response
[
   {
       "id": 13446,
       "partner_name": "60390bec12b7390008c66b0f",
       "content_id": "bdz",
       "content_url": "https://<domain>/v1/content?url=00c104e612cb7f461e6446d77125a0ed3f839048474bf9305700914f865d122d3f70ba890c64544ea6d97a9261d08cbbcbc3e9088bbe821cca92960b9901a9d7",
       "partner_content_url": "https://example.com/test/raw.mp4",
       "partner_cloud_url": "https://example.com/test",
       "createdAt": "2021-02-26T15:19:03.000Z",
       "updatedAt": "2021-02-26T15:41:12.000Z",
       "content_upload_status": "success",
       "content_access": "public",
       "publish_access": "private",
       "content_status_message": "Partner Content on-boarded Successfully",
       "partner_content_file_name": "main.mp4",
       "content_size": 1533202
   }
   ]

Get Whitelist Domain

Request
curl --location --request GET 'https://<domain>/api/v1/stream-tech/get-whitelist-domain?partner_name=<partner_name>' \
--header 'api_key: XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX' \
--data-raw ''
Response
{
   "cors_whitelist_domain": [
       "http://abc.com"
   ]
}

Add Whitelist Domain

Request
curl --location --request POST 'https://<domain>/api/v1/stream-tech/add-whitelist-domain?partner_name=<partner_name>' \
--header 'api_key: XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX' \
--header 'Content-Type: application/json' \
--data-raw ' { "cors_whitelist_domain": "https://xyz.com"}
'
Response
{
   "status": "SUCCESS",
   "message": "Cors whitelist domain added successfully."
}

Delete Whitelist Domain

Request
curl --location --request DELETE 'https://<domain>/api/v1/stream-tech/delete-whitelist-domain?partner_name=<partner_name>' \
--header 'api_key:  XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX' \
--header 'Content-Type: application/json' \
--data-raw '{
 "cors_whitelist_domain": "https://moodleproxy1.testalef.net"
}'
Response
{
   "status": "SUCCESS",
   "message": "Cors whitelist domain deleted successfully."
}