Create 2D viewer token
POST
https://api.catenda.com/v2/projects/{project-id}/viewer2d/token
Path Parameters
- project-idstringrequiredExampleDescription
Body Parameters
- bodyobject
- modelstringExampleDescription
- revisionstringExampleDescription
Responses
200
- viewer-2d-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}/viewer2d/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}/viewer2d/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}/viewer2d/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}/viewer2d/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/viewer2d/geometry?token=ba16ee5e36054019917210c4559bcca0"
}Get a 2D Viewer token to access viewer data.
The response will indicate which revisions the token is valid for.
Default usage is to provide a revision id.