Replies: 5 comments 10 replies
-
With project/getList the behavior seems inconsistent. If the call is unsigned, I get all projects public on the server But if it is signed, I get all projects for the user To be consistent the call should be server-centric and should return all projects accessibly by the user. So an unsigned call would return all projects public on the server and signed call would return all projects public on the server as well as all projects private to the user. |
Beta Was this translation helpful? Give feedback.
-
/projects/getModel should take a parameter for the desired format. Default to .obj but also support returning other formats like .gltf or .glb as well. .gltf and .glb will require occ 7.5 on the server |
Beta Was this translation helpful? Give feedback.
-
Does this API discussion include all calls to the server including those initiated by the FreeCAD client? The use case is this: A user pushes their model to their own CADcloud server, grabs a referencing URL for the model and shares it via chat/email/forum, etc. A user should be able to copy the link and paste it into a corresponding dialog inside FreeCAD and fetch the model directly into their current document. This use-case might have implications upstream. Think about how a google document can be shared; you can share it with specific people via an email address, or you can share it with 'anyone who has the link' The same thing should apply to public projects on a CADcloud server. I should be able to have a 'public' project which anyone can access with the URL but which don't appear in the public website. |
Beta Was this translation helpful? Give feedback.
-
Need a call like /projects/getModelInfo/ to get details about a particular model including fetch-able versions
|
Beta Was this translation helpful? Give feedback.
-
Here's the FreeCAD workbench UI that I'm currently thinking about.
|
Beta Was this translation helpful? Give feedback.
-
The API is not stable, and can evolve pretty fast. Some calls are really not done the way they shall be. Feel free to propose enhancement.
Projects related calls
Public Project list
/projects/[username]/getList
This call returns a list of public projects which can be freely accessed when it is not signed and username is not present (optional parameter). If it is signed and present it does return the public and private projects from a specific end user which has signed the call. Signature process follows Amazon s3 version 2 signature process ((https://docs.aws.amazon.com/general/latest/gr/signature-version-2.html))
The signature is pass into the HTTP header of the request. A bash example could be as follow:
dateFormatted=`TZ=GMT date -R`
relativePath="/projects/getList"
contentType="application/json"
stringToSign="GET\n\n${contentType}\n${dateFormatted}\n${relativePath}"
signature=`echo -en ${stringToSign} | openssl sha1 -hmac ${secretKey} -binary | base64`
curl -s -X GET
-H "Host: justyour.parts"
-H "mydate: ${dateFormatted}"
-H "Content-Type: ${contentType}"
-H "Authorization: JYP ${accessKey}:${signature}"
"https://justyour.parts/projects/getList"
where accessKey and secretKey are provided through the TokenAuth and TokenSecret of the user account.
All following calls could be either unsigned (for public project) or signed for private project.
/projects/getMagnet/
This call is retrieving the base64 encoded magnet of a specific project which is a png format picture.
/projects/getAvatar/
This call is retrieving the base64 encoded public Avatar from project owner. The return data when decrypted is a png file
/projects/getPlayerCode/
This call is retrieving the Xeogl code associated with a specific project
/projects/getModel/
This call is retrieving the Wavefront OBJ model of a specific project
The OBJ file's are split on the backend server due to limitation of Javascript and browser who can handle a maximum size of 64MB strings. If the model is bigger than 16MB it is then split in multi parts.
Beta Was this translation helpful? Give feedback.
All reactions