LoudVoice API \ Authors \ Create new author
LoudVoice API Resources
Resource/URI - Discussions | GET | POST | PUT | DELETE |
---|---|---|---|---|
Discussions
/loudvoice/discussions.json
|
List all discussions | Create a discussion | – | – |
Discussion
/loudvoice/discussions/<discussion_token>.json
|
Read a discussion | – | Update a discussion | Delete a discussion |
Discussion messages
/loudvoice/comments/<discussion_token>/comments.json
|
Read discussion comments | – | – | – |
Resource/URI - Authors | GET | POST | PUT | DELETE |
---|---|---|---|---|
Authors
/loudvoice/authors.json
|
List all authors | Create an author | – | – |
Author
/loudvoice/authors/<author_token>.json
|
Read an author | – | Update an author | Delete an author |
Resource/URI - Author Sessions | GET | POST | PUT | DELETE |
---|---|---|---|---|
Author Sessions
/loudvoice/authors/sessions.json
|
List all sessions | – | Create or update a session | – |
Author Session
/loudvoice/authors/sessions/<session_token>.json
|
– | – | – | Delete a session |
Resource/URI - Comments | GET | POST | PUT | DELETE |
---|---|---|---|---|
Comments
/loudvoice/comments.json
|
List all comments | Create a comment | – | – |
Comment
/loudvoice/comments/<comment_token>.json
|
Read a comment | – | Update a comment | Delete a comment |
Resource/URI - Votes | GET | POST | PUT | DELETE |
---|---|---|---|---|
Votes
/loudvoice/votes.json
|
List all votes |
– | – | – |
Vote
/loudvoice/votes/comments/<comment_token>/authors/<author_token>.json
|
Read a vote | – | Cast a vote | Delete a vote |
Workflow
Request: the code to send to the API
Send an API request to this endpoint in order to create a new author:
POST
/loudvoice/authors.json
POST
data to be included in the request
{ "request": { "author": { "author_reference": "#author_reference#", "identity_token": "#identity_token#", "name": "#name#", "email": "#email#", "picture_url": "#picture_url#", "website_url": "#website_url#", "description": "#description#" } } }
Key | Description |
---|---|
Reference | |
author_referencestring
|
Your custom reference for this author, e.g. the unique id of the user in your system.
The value must be unique amongst all authors. Example : USER-123456 |
Identity | |
identity_tokenstring
|
Links the author to an existing identity and populates the author metadata using the identity data.
Each identity can only be linked to a single author.
Example: 39931bb2-15a8-488b-bcac-dccd9952ae90 |
Metadata | |
* namestring
|
The author's name, as displayed in the LoudVoice widget. If empty, populated from the identity data if available. Example: John Doe |
emailstring
|
The author's email address. If empty, populated from the identity data if available. Example: john.doe@oneall.com |
picture_urlstring, uri
|
The fully qualified URL of the author's avatar If empty, populated from the identity data if available. Example: https://www.example.com/user/avatar.png |
website_urlstring, uri |
The fully qualified URL of the author's website. Example: http://www.example.com/ |
descriptionstring
|
Additional information about the author. Example: A writer by day and a reader by night. |
Result: the code returned by the API
The API will either return a HTTP status code 201
on success or an appropriate message body with
further details on the error that occured.
Resultset Example
{ "response": { "request": { "date": "Fri, 06 Apr 2018 12:49:38 0200", "resource": "/loudvoice/authors.json", "status": { "flag": "created", "code": 201, "info": "Your request has been processed successfully and resulted in a new resource being created" } }, "result": { "data": { "author": { "author_token": "6055a380-549d-45d1-b51e-015aaa0882cc", "identity_token": "5dd7336a-cb66-42dc-95da-1a6dade8f743", "author_reference": "USER-123456", "name": "John Doe", "email": "john.doe@example.com", "picture_url": "http://www.example.com/john-doe/picture.jpg", "website_url": "http://www.example.com/", "description": "A writer by day and a reader by night.",, "num_comments": 0, "date_last_comment": null, "date_creation": "Fri, 06 Apr 2018 12:49:38 0200", "date_last_update": null } } } } }