Hi @Shehzan_Mohammed ,
Thanks for the help, you were right about the type, it should be 3DTILES.
But my problem is not to upload the file to my bucket, this is working, so there is no issue with my AWS keys.
It’s when the upload is done, I’m missing the url to tell ion it can start tilling.
I tried :
var body = onComplete.config.data;
axios.post(onComplete.config.url, body,{
headers: { Authorization: `Bearer ${accessToken}` }
})
.then(response => monitorTilling(response))
.catch(function (error) {
console.log(error);
});
Since I’m missing the onComplete url, I tried with the config.url (https://api.cesium.com/v1/assets)
But I get a
POST https://api.cesium.com/v1/assets 409
So I tried to recreate the onComplete url like this :
var id = onComplete.data.assetMetadata.id;
var url ='https://api.cesium.com/v1/assets/'+id+'/uploadComplete';
var body = onComplete.config.data;
axios.post(url, body,{
headers: { Authorization: `Bearer ${accessToken}` }
})
.then(response => monitorTilling(response))
.catch(function (error) {
console.log(error);
});
but then I get a
POST https://api.cesium.com/v1/assets/1207043/uploadComplete 400
My problem is that when I post to https://api.cesium.com/v1/assets, if I don’t use from, I get in return this :
{
"data": {
"assetMetadata": {
"id": 1207176,
"type": "3DTILES",
"name": "House (1).laz",
"description": "",
"bytes": 0,
"attribution": "",
"dateAdded": "2022-07-14T10:19:01.128Z",
"status": "AWAITING_FILES",
"percentComplete": 0
},
"uploadLocation": {
"bucket": "assets.cesium.com",
"endpoint": "https://s3.amazonaws.com/",
"prefix": "sources/1207176/",
"accessKey": "key",
"secretAccessKey": "key",
"sessionToken": "token"
},
"onComplete": {
"method": "POST",
"url": "https://api.cesium.com/v1/assets/1207176/uploadComplete",
"fields": {}
}
},
"status": 200,
"statusText": "",
"headers": {
"cache-control": "no-cache",
"content-type": "application/json"
},
"config": {
"transitional": {
"silentJSONParsing": true,
"forcedJSONParsing": true,
"clarifyTimeoutError": false
},
"transformRequest": [
null
],
"transformResponse": [
null
],
"timeout": 0,
"xsrfCookieName": "XSRF-TOKEN",
"xsrfHeaderName": "X-XSRF-TOKEN",
"maxContentLength": -1,
"maxBodyLength": -1,
"headers": {
"Accept": "application/json, text/plain, */*",
"Content-Type": "application/json",
"Authorization": "Bearer key"
},
"method": "post",
"url": "https://api.cesium.com/v1/assets",
"data": "{\"name\":\"House (1).laz\",\"description\":\"\",\"type\":\"3DTILES\",\"options\":{\"position\":[2.29,48.85,0.1],\"sourceType\":\"POINT_CLOUD\"}}"
},
"request": {}
}
As you can see, there is a onComplete object, with the url ‘https://api.cesium.com/v1/assets/‘+id+’/uploadComplete’ that you can then use to tell ion the upload is Complete.
but when I use from (so when I create the asset on ion, and tell him I will upload on my own bucket) this is what I get :
{
"data": {
"assetMetadata": {
"id": 1205235,
"type": "3DTILES",
"name": "House (1).laz",
"description": "",
"bytes": 0,
"attribution": "",
"dateAdded": "2022-07-13T20:45:13.364Z",
"status": "NOT_STARTED",
"percentComplete": 0
}
},
"status": 200,
"statusText": "",
"headers": {
"cache-control": "no-cache",
"content-type": "application/json"
},
"config": {
"transitional": {
"silentJSONParsing": true,
"forcedJSONParsing": true,
"clarifyTimeoutError": false
},
"transformRequest": [
null
],
"transformResponse": [
null
],
"timeout": 0,
"xsrfCookieName": "XSRF-TOKEN",
"xsrfHeaderName": "X-XSRF-TOKEN",
"maxContentLength": -1,
"maxBodyLength": -1,
"headers": {
"Accept": "application/json, text/plain, */*",
"Content-Type": "application/json",
"Authorization": "Bearer key"
},
"method": "post",
"url": "https://api.cesium.com/v1/assets",
"data": "{\"name\":\"House (1).laz\",\"description\":\"\",\"type\":\"3DTILES\",\"options\":{\"position\":[2.29,48.85,0.1],\"sourceType\":\"POINT_CLOUD\"},\"from\":{\"type\":\"S3\",\"bucket\":\"bucket\",\"prefixes\":[\"myprefix/prefix\"],\"credentials\":{\"accessKey\":\"key\",\"secretAccessKey\":\"key\"}}}"
},
"request": {}
}
As you can see, there is no onComplete.url. There is no onComplete object at all.
So my question is, how do you tell ion, you have finished uploading on your own bucket, start tilling please ?