> For the complete documentation index, see [llms.txt](https://documentation.efalia.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.efalia.com/api-reference/efalia-doc-api/onlyoffice.md).

# OnlyOffice

## POST /api/only-office/token

> Signer la configuration à envoyer à Only Office

```json
{"openapi":"3.1.0","info":{"title":"Efalia Doc","version":"1.0.0"},"tags":[{"name":"OnlyOffice"}],"servers":[{"url":"https://interne.efalia.cloud:1202/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","scheme":"bearer","description":"Value: Bearer {jwt}"}},"responses":{"Unauthorized":{"description":"Le JWT a expiré","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"NonHabilite":{"description":"L'utilisateur n'est pas habilité à faire l'action","content":{"application/json":{"schema":{"type":"object","required":["message","code"],"properties":{"message":{"type":"string"},"code":{"type":"string","enum":["non_habilite","changement_mot_de_passe_requis"]}}}}}},"UnsupportedMediaType":{"description":"Le format de la requête n'est pas supporté","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"ApiUnavailable":{"description":"L'api n'est actuellement pas disponible","content":{"application/json":{"schema":{"type":"object","required":["message","code"],"properties":{"message":{"type":"string"},"code":{"type":"string","enum":["mise_a_jour_api_en_cours"]}}}}}}}},"paths":{"/api/only-office/token":{"post":{"operationId":"signerConfigOnlyOffice","summary":"Signer la configuration à envoyer à Only Office","tags":["OnlyOffice"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"description":"Tableau de données clés/valeurs libre","type":"object"}}}},"responses":{"200":{"description":"JWT signé de la configuration OnlyOffice","content":{"application/json":{"schema":{"type":"object","required":["token"],"properties":{"token":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/NonHabilite"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"503":{"$ref":"#/components/responses/ApiUnavailable"}}}}}}
```

## Récupère les urls à destination d'OnlyOffice

> Cet endpoint retourne les URLs de récupération du binaire d'un document et de callback à destination d'OnlyOffice

```json
{"openapi":"3.1.0","info":{"title":"Efalia Doc","version":"1.0.0"},"tags":[{"name":"OnlyOffice"}],"servers":[{"url":"https://interne.efalia.cloud:1202/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","scheme":"bearer","description":"Value: Bearer {jwt}"}},"schemas":{"DocumentId":{"type":"string","format":"uuid"}},"responses":{"Unauthorized":{"description":"Le JWT a expiré","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"NonHabilite":{"description":"L'utilisateur n'est pas habilité à faire l'action","content":{"application/json":{"schema":{"type":"object","required":["message","code"],"properties":{"message":{"type":"string"},"code":{"type":"string","enum":["non_habilite","changement_mot_de_passe_requis"]}}}}}},"ApiUnavailable":{"description":"L'api n'est actuellement pas disponible","content":{"application/json":{"schema":{"type":"object","required":["message","code"],"properties":{"message":{"type":"string"},"code":{"type":"string","enum":["mise_a_jour_api_en_cours"]}}}}}}}},"paths":{"/api/only-office/{id}/acces":{"get":{"operationId":"recupererUrlsOnlyOffice","summary":"Récupère les urls à destination d'OnlyOffice","description":"Cet endpoint retourne les URLs de récupération du binaire d'un document et de callback à destination d'OnlyOffice","tags":["OnlyOffice"],"parameters":[{"in":"path","name":"id","description":"L'id du document","required":true,"schema":{"$ref":"#/components/schemas/DocumentId"}}],"responses":{"200":{"description":"Urls à destination d'OnlyOffice","content":{"application/json":{"schema":{"title":"Urls à destination d'OnlyOffice","type":"object","properties":{"binaire":{"type":"string","description":"Url pour la récupération du document"},"callback":{"type":"string","description":"Url de callback pour l'écriture du document"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/NonHabilite"},"503":{"$ref":"#/components/responses/ApiUnavailable"}}}}}}
```

## Remplacer le binaire d'un document à partir de onlyoffice

> Cet endpoint ne doit être appelé que par OnlyOffice

```json
{"openapi":"3.1.0","info":{"title":"Efalia Doc","version":"1.0.0"},"tags":[{"name":"OnlyOffice"}],"servers":[{"url":"https://interne.efalia.cloud:1202/"}],"security":[{"JwtOnlyOffice":[]}],"components":{"securitySchemes":{"JwtOnlyOffice":{"type":"apiKey","name":"authorization","in":"query","description":"Jwt généré par l'endpoint d'accès à OnlyOffice."}},"schemas":{"DocumentId":{"type":"string","format":"uuid"}},"responses":{"Unauthorized":{"description":"Le JWT a expiré","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"NonHabilite":{"description":"L'utilisateur n'est pas habilité à faire l'action","content":{"application/json":{"schema":{"type":"object","required":["message","code"],"properties":{"message":{"type":"string"},"code":{"type":"string","enum":["non_habilite","changement_mot_de_passe_requis"]}}}}}},"UnsupportedMediaType":{"description":"Le format de la requête n'est pas supporté","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"ErreurServeur":{"description":"Le fichier n'a pas pu être écrit correctement","content":{"application/json":{"schema":{"type":"object","required":["message","code"],"properties":{"message":{"type":"string"},"code":{"type":"string","enum":["fichier_corrompu","ecriture_sur_disque_impossible"]}}}}}},"ApiUnavailable":{"description":"L'api n'est actuellement pas disponible","content":{"application/json":{"schema":{"type":"object","required":["message","code"],"properties":{"message":{"type":"string"},"code":{"type":"string","enum":["mise_a_jour_api_en_cours"]}}}}}}}},"paths":{"/api/only-office/{id}/remplacer":{"post":{"operationId":"callbackOnlyOffice","summary":"Remplacer le binaire d'un document à partir de onlyoffice","description":"Cet endpoint ne doit être appelé que par OnlyOffice","tags":["OnlyOffice"],"parameters":[{"in":"path","name":"id","description":"L'id du document","required":true,"schema":{"$ref":"#/components/schemas/DocumentId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["status"],"properties":{"status":{"type":"integer","description":"Cf documentation OnlyOffice (https://api.onlyoffice.com/editors/callback)"},"url":{"type":"string","description":"L'url qui permet d'accéder au document sur onlyOffice"}}}}}},"responses":{"200":{"description":"La clé `error` indique si le remplacement a fonctionné. `0` indique un succès.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"integer"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/NonHabilite"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"500":{"$ref":"#/components/responses/ErreurServeur"},"503":{"$ref":"#/components/responses/ApiUnavailable"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://documentation.efalia.com/api-reference/efalia-doc-api/onlyoffice.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
