Create 3D viewer token
POST
https://api.catenda.com/v2/projects/{project-id}/viewer3d/token
Path Parameters
- project-idstringrequiredExampleDescription
Body Parameters
- bodyobject
- modelsstring[]Description
- revisionsstring[]Description
Responses
200
- viewer-3d-tokenDescription
- revisionsmodel-revision[]Description
- commentstringExampleDescription
- createdAtstringExampleDescription
- idstringExampleDescription
- modelmodelDescription
- idstringExampleDescription
- namestringExampleDescription
- useruserDescription
- idstringExampleDescription
- namestringExampleDescription
- usernamestringExampleDescription
- emailstringExampleDescription
- createdAtstringExampleDescription
- avatarUrlstringExampleDescription
- typestringExampleDescription
- versionintegerExampleDescription
- tokenstringExampleDescription
- urlstringExampleDescription
curl
curl --request POST \
--url https://api.catenda.com/v2/projects/{project-id}/viewer3d/token \
--header 'accept: application/json'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var requestOptions = {
method: 'POST',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api.catenda.com/v2/projects/{project-id}/viewer3d/token", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.catenda.com/v2/projects/{project-id}/viewer3d/token")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.catenda.com/v2/projects/{project-id}/viewer3d/token"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// OK
{
"revisions": [
{
"comment": "Revision description",
"createdAt": "2016-09-26T14:45:20.000Z",
"id": "924809076a694255c489d236517a55da",
"model": {
"id": "47024671cbd642a9c7c84808d4d509f5",
"name": "Model description"
},
"user": {
"id": "524809076a694255b989d236517a55da",
"name": "John Doe",
"username": "[email protected]",
"email": "[email protected]",
"createdAt": "2016-09-20T14:55:22.000Z",
"avatarUrl": "https://api.catenda.com/v2/avatar/397t0ccd8f74516096c738de15dc6512",
"type": "user"
},
"version": 1
}
],
"token": "ba16ee5e36054019917210c4559bcca0",
"url": "https://api.catenda.com/v2/projects/67551168422040148d8ae198a321494d/viewer3d/data?token=ba16ee5e36054019917210c4559bcca0"
}Get a 3D viewer token to access viewer data.
The response will indicate which revisions the token is valid for.
By default, the token will be valid for latest revisions of all models in the project.
By providing a request body the token will be limited to only the specified models and revisions.