Office editing

Opening Word, Excel and PowerPoint files in Bramble Office (needs the Docs, Sheets or Slides licence), creating new blank ones, and the start pages' recent files. The /wopi/... endpoints are how the editor reads and saves the file, each call carrying an access token Drive issued for that file; they're refused through the gateway.

MethodPathSummary
GET/wopi/files/:idFile details for the editor (WOPI CheckFileInfo)
GET/wopi/files/:id/contentsFile contents for the editor (WOPI GetFile)
POST/wopi/files/:id/contentsSave from the editor (WOPI PutFile)
POST/wopi/files/:idOther editor requests (WOPI)
GET/api/v2/office/configWhich Office apps you can use
GET/api/v2/office/recentThe Docs / Sheets / Slides start pages: that kind's files the person can reach (their drive, their libraries, shared with them), newest first
POST/api/v2/office/:id/sessionOpens a file in the editor: the URL to post to and the token to post
POST/api/v2/office/newA new blank Word document, spreadsheet or presentation in a folder

#File details for the editor (WOPI CheckFileInfo)

GET/wopi/files/:id
Address
https://<your-org>.brambleit.cloud/drive/wopi/files/:id
Requires
None: public, or protected by a token in the address or body.

Path parameters

NameTypeDescription
idrequiredinteger

Response 200

FieldTypeDescription
BaseFileNamestring
BreadcrumbDocNamestring
Sizenumber
Versionarray of any
LastModifiedTimeany
OwnerIdstring
UserIdstring
UserFriendlyNamestring
UserCanWriteany
ReadOnlyboolean
UserCanNotWriteRelativeboolean
UserCanRenameboolean
SupportsRenameboolean
SupportsUpdateboolean
SupportsLocksboolean
PostMessageOriginany
ClosePostMessageboolean
EnableInsertRemoteImageboolean
EnableShareboolean
IsAdminUserboolean
IsAnonymousUserboolean
Example response
JSON
{
  "BaseFileName": "Example basefilename",
  "BreadcrumbDocName": "Example breadcrumbdocname",
  "Size": 12.5,
  "Version": [],
  "LastModifiedTime": null,
  "OwnerId": "string",
  "UserId": "string",
  "UserFriendlyName": "Example userfriendlyname",
  "UserCanWrite": null,
  "ReadOnly": false,
  "UserCanNotWriteRelative": false,
  "UserCanRename": false,
  "SupportsRename": false,
  "SupportsUpdate": false,
  "SupportsLocks": false,
  "PostMessageOrigin": null,
  "ClosePostMessage": false,
  "EnableInsertRemoteImage": false,
  "EnableShare": false,
  "IsAdminUser": false,
  "IsAnonymousUser": false
}

Example request

Bash
curl -X GET 'https://<your-org>.brambleit.cloud/drive/wopi/files/42' \
  -H "X-API-Key: $BRAMBLE_KEY"

#File contents for the editor (WOPI GetFile)

GET/wopi/files/:id/contents
Address
https://<your-org>.brambleit.cloud/drive/wopi/files/:id/contents
Requires
None: public, or protected by a token in the address or body.

Path parameters

NameTypeDescription
idrequiredinteger

Response

A body, an empty body.

Example request

Bash
curl -X GET 'https://<your-org>.brambleit.cloud/drive/wopi/files/42/contents' \
  -H "X-API-Key: $BRAMBLE_KEY"

#Save from the editor (WOPI PutFile)

POST/wopi/files/:id/contents
Address
https://<your-org>.brambleit.cloud/drive/wopi/files/:id/contents
Requires
None: public, or protected by a token in the address or body.
Headers
x-cool-wopi-timestamp, x-lool-wopi-timestamp

Path parameters

NameTypeDescription
idrequiredinteger

Response 200

FieldTypeDescription
LastModifiedTimeany
Example response
JSON
{
  "LastModifiedTime": null
}

Example request

Bash
curl -X POST 'https://<your-org>.brambleit.cloud/drive/wopi/files/42/contents' \
  -H "X-API-Key: $BRAMBLE_KEY"

#Other editor requests (WOPI)

POST/wopi/files/:id

Locks, "Save as", rename: not offered (see CheckFileInfo).

Address
https://<your-org>.brambleit.cloud/drive/wopi/files/:id
Requires
None: public, or protected by a token in the address or body.

Path parameters

NameTypeDescription
idrequiredinteger

Response

An empty body.

Example request

Bash
curl -X POST 'https://<your-org>.brambleit.cloud/drive/wopi/files/42' \
  -H "X-API-Key: $BRAMBLE_KEY"

#Which Office apps you can use

GET/api/v2/office/config
Address
https://<your-org>.brambleit.cloud/drive/api/v2/office/config
Requires
Signed-in session, X-API-Key, or a Bramble app access token (Authorization: Bearer).
Licence: Drive.

Response 200

Example request

Bash
curl -X GET 'https://<your-org>.brambleit.cloud/drive/api/v2/office/config' \
  -H "X-API-Key: $BRAMBLE_KEY"

#The Docs / Sheets / Slides start pages: that kind's files the person can reach (their drive, their libraries, shared with them), newest first

GET/api/v2/office/recent
Address
https://<your-org>.brambleit.cloud/drive/api/v2/office/recent
Requires
Signed-in session, X-API-Key, or a Bramble app access token (Authorization: Bearer).
Licence: Drive.

Query parameters

NameTypeDescription
appany
kindstring
qany

Response 200

FieldTypeDescription
itemsarray of any
locationsarray of any
licensedboolean
Example response
JSON
{
  "items": [],
  "locations": [],
  "licensed": false
}

Errors

StatusMessage
400Unknown kind

Example request

Bash
curl -X GET 'https://<your-org>.brambleit.cloud/drive/api/v2/office/recent' \
  -H "X-API-Key: $BRAMBLE_KEY"

#Opens a file in the editor: the URL to post to and the token to post

POST/api/v2/office/:id/session

Opens a file in the editor: the URL to post to and the token to post. Editors and owners edit; viewers (or ?mode=view) get it read-only.

Address
https://<your-org>.brambleit.cloud/drive/api/v2/office/:id/session
Requires
Signed-in session, X-API-Key, or a Bramble app access token (Authorization: Bearer).
Licence: Drive.

Path parameters

NameTypeDescription
idrequirednumber

Request body JSON

NameTypeDescription
modeany

Response 200

FieldTypeDescription
urlstring
access_tokenstring
access_token_ttlany
writeany
itemany
pathstring
Example response
JSON
{
  "url": "https://example.com/…",
  "access_token": "…",
  "access_token_ttl": null,
  "write": null,
  "item": null,
  "path": "string"
}

Errors

StatusMessage
503Office editing is not switched on
400Only files can be opened
409This file is still being moved to new storage — try again later

Example request

Bash
curl -X POST 'https://<your-org>.brambleit.cloud/drive/api/v2/office/12.5/session' \
  -H "X-API-Key: $BRAMBLE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"mode":"…"}'

#A new blank Word document, spreadsheet or presentation in a folder

POST/api/v2/office/new
Address
https://<your-org>.brambleit.cloud/drive/api/v2/office/new
Requires
Signed-in session, X-API-Key, or a Bramble app access token (Authorization: Bearer).
Licence: Drive.

Request body JSON

NameTypeDescription
kindstring
namestring

Response 201

Errors

StatusMessage
503Office editing is not switched on
400Choose a document, spreadsheet or presentation

Example request

Bash
curl -X POST 'https://<your-org>.brambleit.cloud/drive/api/v2/office/new' \
  -H "X-API-Key: $BRAMBLE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"kind":"string","name":"Example name"}'