Upload a file
const url = 'https://api.blupinta.app/v1/projects/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/files';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'image/png'}, body: 'example'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.blupinta.app/v1/projects/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/files \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: image/png' \ --data exampleA drawing or an image for the project’s home: the body is the file’s bytes, content-type says what they are (PNG, JPEG, WebP or PDF, checked against the bytes) and ?name= its name. Its sha256 is how a home names it. The same bytes again are the same file (200, not 201).
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”One of the projects the person chose when connecting the app
Query Parameters
Section titled “Query Parameters”The file’s name, as people read it; file without
Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “ Responses ”The project had the same file already
A file of a project, as uploaded
object
Its content’s hash: how a home names it (a drawing’s src, a floor’s image)
In bytes
Its name, as uploaded
When it was first uploaded, ISO 8601
Example
{ "contentType": "image/png"}Headers
Section titled “Headers”The requests the caller may make in the window: an app counts per connection, every token together
The requests left in the window
Seconds until the window starts again
Upload a file
A file of a project, as uploaded
object
Its content’s hash: how a home names it (a drawing’s src, a floor’s image)
In bytes
Its name, as uploaded
When it was first uploaded, ISO 8601
Example
{ "contentType": "image/png"}Headers
Section titled “Headers”The requests the caller may make in the window: an app counts per connection, every token together
The requests left in the window
Seconds until the window starts again
unauthenticated: No valid access token for this API
The body of a refusal
object
What /v1 answers when it refuses
The server’s id for a server_error, to quote when asking for help
What is wrong, for invalid_input, conflict, invalid_home, blocking_problems
Example
{ "error": "unauthenticated"}Headers
Section titled “Headers”The requests the caller may make in the window: an app counts per connection, every token together
The requests left in the window
Seconds until the window starts again
forbidden: The token lacks the scope this operation needs
The body of a refusal
object
What /v1 answers when it refuses
The server’s id for a server_error, to quote when asking for help
What is wrong, for invalid_input, conflict, invalid_home, blocking_problems
Example
{ "error": "unauthenticated"}Headers
Section titled “Headers”The requests the caller may make in the window: an app counts per connection, every token together
The requests left in the window
Seconds until the window starts again
not_found: Nothing there, or nothing this token may read
The body of a refusal
object
What /v1 answers when it refuses
The server’s id for a server_error, to quote when asking for help
What is wrong, for invalid_input, conflict, invalid_home, blocking_problems
Example
{ "error": "unauthenticated"}Headers
Section titled “Headers”The requests the caller may make in the window: an app counts per connection, every token together
The requests left in the window
Seconds until the window starts again
unsupported_file: Not a PNG, JPEG, WebP or PDF, or its bytes aren’t the type it says
The body of a refusal
object
What /v1 answers when it refuses
The server’s id for a server_error, to quote when asking for help
What is wrong, for invalid_input, conflict, invalid_home, blocking_problems
Example
{ "error": "unauthenticated"}Headers
Section titled “Headers”The requests the caller may make in the window: an app counts per connection, every token together
The requests left in the window
Seconds until the window starts again
rate_limited: Too many requests: wait as long as Retry-After says
The body of a refusal
object
What /v1 answers when it refuses
The server’s id for a server_error, to quote when asking for help
What is wrong, for invalid_input, conflict, invalid_home, blocking_problems
Example
{ "error": "unauthenticated"}Headers
Section titled “Headers”The requests the caller may make in the window: an app counts per connection, every token together
The requests left in the window
Seconds until the window starts again
Seconds to wait before asking again
server_error: Something failed on Blupinta’s side: quote errorId when asking for help
The body of a refusal
object
What /v1 answers when it refuses
The server’s id for a server_error, to quote when asking for help
What is wrong, for invalid_input, conflict, invalid_home, blocking_problems
Example
{ "error": "unauthenticated"}Headers
Section titled “Headers”The requests the caller may make in the window: an app counts per connection, every token together
The requests left in the window
Seconds until the window starts again