| 76 | |
| 77 | === Create topic === |
| 78 | |
| 79 | **Request** |
| 80 | |
| 81 | {{{ |
| 82 | POST /core/topic |
| 83 | |
| 84 | <the topic> |
| 85 | }}} |
| 86 | |
| 87 | Curl example: |
| 88 | |
| 89 | {{{ |
| 90 | curl -X POST -H Content-Type:application/json -d ' |
| 91 | {type_uri: "dm4.notes.note", |
| 92 | composite: {dm4.notes.title: "My title", dm4.notes.text: "My text"} |
| 93 | }' localhost:8080/core/topic |
| 94 | }}} |
| 95 | |
| 96 | For details about the topic data format see DataFormat#topic. |
| 97 | |
| 98 | **Response** |
| 99 | |
| 100 | {{{ |
| 101 | HTTP/1.1 200 OK |
| 102 | Content-Type: application/json |
| 103 | |
| 104 | { |
| 105 | "id": 3298, |
| 106 | "uri": "", |
| 107 | "type_uri": "dm4.notes.note", |
| 108 | "value": "My title", |
| 109 | "composite": { |
| 110 | "dm4.notes.title": "My title", |
| 111 | "dm4.notes.text":"My text" |
| 112 | } |
| 113 | } |
| 114 | }}} |