Skip to content

Commit

Permalink
Create blogpost for release 0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
Art4 committed Jan 10, 2019
1 parent 9995134 commit 5282c95
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/_posts/2017-06-04-Youthweb-API-0.9.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
112 changes: 112 additions & 0 deletions docs/_posts/2019-01-13-Youthweb-API-0.14.md
Original file line number Diff line number Diff line change
@@ -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 %}

0 comments on commit 5282c95

Please sign in to comment.