Using an Upload script
Learn how to write a simple script to automatically upload apps to Eagle 3D Streaming, and also how to remove an app or a specific version programmatically. The examples provided work with various programming environments, including JavaScript, PHP, Ruby, and Python. Follow the instructions below.
GET https://upload-api.eagle3dstreaming.com/api/v2/external/upload-url
Request
Query Parameters
Key | Value | Description |
---|---|---|
|
| Secret API key provided by E3DS. To find more on API key read this document. |
|
| The name of the application |
|
| Size of file in GB |
API key can be found by following this doc : Getting API Key
Response
Success Response
Status Code 200 OK
Example Response
{
"status": "success",
"data": {
"filePath": "owner-name/app-name/1.zip",
"url": "https://storage.googleapis.com/e3ds-master.appspot.com/owner-name/app-name/1.zip?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=642640802991-compute%40developer.gserviceaccount.com%2F20231212%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20231212T161235Z&X-Goog-Expires=900&X-Goog-SignedHeaders=content-type%3Bhost&X-Goog-Signature=42dffe760fe6d64538f8f49d609cd08d60ffbce7e32ac208d437c082692ead2a1f4a9900a78b220e5059463f1743d09e1f8285c420283fe45c0ce25726d632aec1f7847b792312e645ece331afcce0fa7191d385ebe61bec8ee646cee093f68a3f890b6222f7e8a595babd405fb6f4d0bd43b6ee5b7a2d7956b79433c5657d2338d7b7830a20129262a1dab1977d28491174be3e897a0561828cd52a3398c5989f0f023e441832a85e145ab56ec324889d4c6affabbf3742c1bbcf23cda8ac5e5f7ebdb16e8bf989cb4dfdadc3eb1cd4d65b6a16297d9ebb921b97055d46b856351c9673b9b33ca46874071a417ed0f1dd5f8a37d3e06e979ea8e7b5771d2294",
"willOverwrite": false
}
}
Error Response
Status Code 400 Bad Request
500 Internal Server Error
Example Response 400 Bad Request
{
"status": "error",
"message": "appName is missing from the request query"
}
Example Response 500 Internal Server Error
{
"status": "error",
"message": "Decryption error : error decrypting"
}
Guideline to produce script in any programming environment (Js/PHP/Ruby/Python)
Fetch the upload link by using the URL mentioned in the top of the documentation
Setup a network call with the following configuration:
METHOD: PUT
URL: Upload Link fetched from the previous step
Data aka Request Body: A stream of the file to be uploaded
Headers:
Content-Type:
'application/octet-stream'
x-ms-blob-type:
'BlockBlob'
Content-Length: Size of the file to be uploaded in bytes
Run the code.
Happy Uploading !!!
Examples
Node.js
const axios = require('axios')
const fs = require('fs');
const filePath = 'path/to/your/file'; // Replace with the actual file path
const stat = fs.statSync(filePath);
const sizeInBytes = stat.size;
// Convert bytes to gigabytes
const sizeInGB = sizeInBytes / (1024 * 1024 * 1024);
console.log(`File size: ${sizeInGB.toFixed(2)} GB`);
// Get the size of the file
const size = fs.statSync(filePath).size;
axios.get('https://upload-api.eagle3dstreaming.com/api/v2/external/upload-url', {
params: {
apiKey: "YOUR_API_KEY", // Replace with your E3DS Api Key
appName: "app-name",
fileSize: sizeInGB // note: File Size must be in GB here
}
}).then(function (response) {
console.log("Received Upload Url");
const uploadUrl = response.data.data.url;
// Create a stream of the file
const stream = fs.createReadStream(filePath);
// Upload the file
axios.put(uploadUrl, stream, {
headers: {
'Content-Type': 'application/octet-stream',
'x-ms-blob-type': 'BlockBlob',
'Content-Length': sizeInBytes //note: File Size must be in bytes here
}
}).then(response => {
console.log('File uploaded successfully', response.data);
}).catch(error => {
console.error('Error uploading file', error);
});
}).catch(function (error) {
console.log("An Error Occured");
console.log(error);
})
cURL:
File size in GB. Put your file size manually.
curl "https://upload-api.eagle3dstreaming.com/api/v2/external/upload-url?apiKey=YOUR_API_KEY&appName=app-name&fileSize=4.6"
If you need to remove your App or a version of your App programmatically, follow the instructions below:
1. API to remove an App
Method: POST
URL: https://agw.eaglepixelstreaming.com/api/v3/us/streamingapp-remove
Payload: (Request Body)
{
"apiKey" : "API_KEY", // (String)
"appName" : "APP_NAME", // (String)
}
2. API to remove a version of an App
Method: POST
URL: https://agw.eaglepixelstreaming.com/api/v3/us/streamingapp-version-remove
Payload: (Request Body)
{
"apiKey" : "API_KEY", // (String)
"appName" : "APP_NAME", // (String)
"appVersion" : "1" // (String)
}
Need help? Contact Support
Submit a new request at E3DS support portal.
Requests sent on weekends will not be addressed until the following business day.