From 5282c95b8768693750100b23077316bac61708f9 Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 10 Jan 2019 15:41:06 +0100 Subject: [PATCH] Create blogpost for release 0.14 --- docs/_posts/2017-06-04-Youthweb-API-0.9.md | 2 +- docs/_posts/2019-01-13-Youthweb-API-0.14.md | 112 ++++++++++++++++++++ 2 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 docs/_posts/2019-01-13-Youthweb-API-0.14.md diff --git a/docs/_posts/2017-06-04-Youthweb-API-0.9.md b/docs/_posts/2017-06-04-Youthweb-API-0.9.md index 76a3190..4908e21 100644 --- a/docs/_posts/2017-06-04-Youthweb-API-0.9.md +++ b/docs/_posts/2017-06-04-Youthweb-API-0.9.md @@ -8,7 +8,7 @@ summary: "Die neue Version der Youthweb-API erlaubt jetzt das Erstellen von Post ### Neu -- Es ist jetzt möglich, Posts an den Pinnwände von User zu erstellen +- Es ist jetzt möglich, [Posts an den Pinnwände von User zu erstellen](https://developer.youthweb.net/api_endpoint_object_posts.html#create) - Es gibt einen neuen Scope `post:write`, um im Namen eines Users Posts an Pinnwänden erstellen zu dürfen. Dieser Scope beinhaltet auch `post:read`. ## Beispiele diff --git a/docs/_posts/2019-01-13-Youthweb-API-0.14.md b/docs/_posts/2019-01-13-Youthweb-API-0.14.md new file mode 100644 index 0000000..fe7e3bc --- /dev/null +++ b/docs/_posts/2019-01-13-Youthweb-API-0.14.md @@ -0,0 +1,112 @@ +--- +title: "Youthweb-API 0.14 erlaubt das Erstellen von Kommentarn zu Posts" +categories: API +tags: [api, release] +summary: "Die neue Version der Youthweb-API erlaubt jetzt das Erstellen von Comments-Resourcen zu Posts-Resource." +--- +## Changelog + +### Neu + +- Es ist jetzt möglich, [Kommentare zu einem Post zu erstellen](https://developer.youthweb.net/api_endpoint_object_comments.html#create) + +## Beispiele + +### Einen Kommentar zu einem Post erstellen + +**Request** + +``` +POST https://api.youthweb.net/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/comments +Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14 +Content-Type: application/vnd.api+json +Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0NTgyMzE2MDAsImlzcyI6IkpOdlBnY3ROcEg1Y0s2UmMifQ.BOn0XFDDYa5iBHJb636A0C0m4sU5NO8SA_CPOVHoWNs + +{ + "data": { + "type": "comments", + "attributes": { + "content": "Lorem ipsum dolor sit amet, sed libris elaboraret eu.", + } + } +} +``` + +**Response** + +``` +Status: 201 Created +Accept: application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.14 +Content-Type: application/vnd.api+json +Location: /comments/d5a5a2c3-041b-4985-907c-74a2131efc98 + +{ + "data": + { + "type": "comments", + "id": "345678", + "attributes": { + "content": "Lorem ipsum dolor sit amet, sed libris elaboraret eu.", + "created_at": "2019-01-01T20:00:00+00:00", + }, + "relationships": { + "author": + { + "links": + { + "self": "/comments/345678/relationships/author", + "related": "/comments/345678/author" + }, + "data": + { + "type": "users", + "id": "1" + } + }, + "parent": + { + "links": + { + "self": "/comments/345678/relationships/parent", + "related": "/comments/345678/parent" + }, + "data": + { + "type": "posts", + "id": "d5a5a2c3-041b-4985-907c-74a2131efc98" + } + } + }, + "links": { + "self": "/comments/345678" + } + }, + "included": + [ + { + "type": "users", + "id": "1", + "attributes": {}, + "links": + { + "self": "/users/123456" + } + }, + { + "type": "posts", + "id": "d5a5a2c3-041b-4985-907c-74a2131efc98", + "attributes": {}, + "links": + { + "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98" + } + } + ], + "links": + { + "self": "/posts/d5a5a2c3-041b-4985-907c-74a2131efc98/comments" + } +} +``` + +{% include links.html %}