# API di Discourse Drafts non funziona

**URL:** <https://meta.discourse.org/t/discourse-drafts-api-not-working/265036>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [15 Maggio 2023, 10:23am UTC](https://meta.discourse.org/t/discourse-drafts-api-not-working/265036 "2023-05-15T10:23:12Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![fahadaslam98](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fahadaslam98/32/299547_2.png) [@fahadaslam98](https://meta.discourse.org/u/fahadaslam98)\
**Post date:** [15 Maggio 2023, 10:23am UTC](https://meta.discourse.org/t/discourse-drafts-api-not-working/265036/1 "2023-05-15T10:23:12Z")

</div>

Sto riscontrando un problema durante l’implementazione dell’API drafts utilizzando Spring Boot. Tutte le API funzionano, ma questa API mi sta dando del filo da torcere e non riesco a capire il problema.

Qualcuno l’ha implementata e potrebbe guidarmi attraverso il problema? Sto inserendo l’errore che riesco a catturare nell’eccezione:

```plaintext
2023-05-15 15:09:44.310 ERROR 880 --- [nio-5000-exec-1] c.b.c.e.advice.ExceptionHandlerAdvice : ** Exception Leaked & captured : JsonParseException; Unrecognized token 'Optional': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
 at [Source: (String)"Optional[java.nio.HeapByteBuffer[pos=0 lim=16187 cap=16187]]"; line: 1, column: 9]
2023-05-15 15:09:44.315 DEBUG 880 --- [nio-5000-exec-1] s.s.w.c.SecurityContextPersistenceFilter : Cleared SecurityContextHolder to complete request
com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'Optional': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')

```

Ecco anche il payload e l’URL “/drafts.json”:

```plaintext
{
    "draft_key": "new_topic",
    "sequence": 94,
    "data": {
        "reply": "estaetwetweas sfasdf asdfa sdf as ",
        "action": "createTopic",
        "title": "test test test",
        "categoryId": 5,
        "archetypeId": "regular",
        "metaData": null,
        "composerTime": 19025,
        "typingTime": 4800
    }
}

```

---

_[View the full topic](https://meta.discourse.org/t/discourse-drafts-api-not-working/265036)._
