Newshub API specification (1.10.5)

Download OpenAPI specification:Download

The newshub service implements all newshub functions for GroupAlarm

Authentication

API_Token

To use this API, you need an API-Token from the RBAC settings of your GroupAlarm organization. Place the token inside the HTTP-Header API-Token for every request, otherwise the API will return an "401 Unauthorized" error for your request.

Security scheme type: API Key
header parameter name: API-TOKEN

Personal-Access-Token

To use this API, you need a Personal Access Token from your profile settings. Place the token inside the HTTP-Header Personal-Access-Token for every request, otherwise the API will return an "401 Unauthorized" error for your request.

Security scheme type: API Key
header parameter name: Personal-Access-Token

newshub

CreateArticle

Inserts a new article in the newshub (only for admins)

Request Body schema: application/json
content
required
string

content of this article

id
integer <int64>

id of the article

lastModification
string <date-time>

last modification date of this article

name
required
string

name of the article

publishingDate
required
string <date-time>

time of publishing of of this article

read
boolean

defines if the user has read the article

Responses

201

created article payload with id and creation_date

400

missing or invalid parameter

500

Unexpected database error

post /newshub/article
https://app.groupalarm.com/api/v1/newshub/article

Request samples

application/json
Copy
Expand all Collapse all
{
  • "content": "string",
  • "id": 0,
  • "lastModification": "2019-06-17T14:31:59Z",
  • "name": "string",
  • "publishingDate": "2019-06-17T14:31:59Z",
  • "read": true
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "content": "string",
  • "id": 0,
  • "lastModification": "2019-06-17T14:31:59Z",
  • "name": "string",
  • "publishingDate": "2019-06-17T14:31:59Z",
  • "read": true
}

GetArticle

Returns the requested article with the passed id

path Parameters
id
required
int64

id of the requested article

Responses

200

requested article

400

missing or invalid parameter

500

Unexpected database error

get /newshub/article/{id}
https://app.groupalarm.com/api/v1/newshub/article/{id}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "content": "string",
  • "id": 0,
  • "lastModification": "2019-06-17T14:31:59Z",
  • "name": "string",
  • "publishingDate": "2019-06-17T14:31:59Z",
  • "read": true
}

DeleteArticle

Deletes an article from the newshub (only for admins)

path Parameters
id
required
int64

id of an article

Responses

200

successfully deleted the article with the passed id

400

missing or invalid parameter

500

Unexpected database error

put /newshub/article/{id}
https://app.groupalarm.com/api/v1/newshub/article/{id}

GetArticles

Returns paginated global articles from the newshub

query Parameters
limit
int64

max. amount of entries in list

offset
int64

amount of entries to skip

Responses

200

recent news article payload

500

Unexpected database error

get /newshub/articles
https://app.groupalarm.com/api/v1/newshub/articles

Response samples

application/json
Copy
Expand all Collapse all
{
  • "articles":
    [
    ],
  • "totalArticles": 0
}

GetPublished

Returns all paginated published articles from the newshub

query Parameters
limit
int64

max. amount of entries in list

offset
int64

amount of entries to skip

Responses

200

paginated published news articles

500

Unexpected database error

get /newshub/articles/published
https://app.groupalarm.com/api/v1/newshub/articles/published

Response samples

application/json
Copy
Expand all Collapse all
{
  • "articles":
    [
    ],
  • "totalArticles": 0
}

GetUnreadArticles

Returns all unread articles from the newshub

Responses

200

unread news articles

500

Unexpected database error

get /newshub/articles/unread
https://app.groupalarm.com/api/v1/newshub/articles/unread

Response samples

application/json
Copy
Expand all Collapse all
[
  • {
    }
]

GetUserReadArticles

Returns the id of the last read article for the current user

Responses

200

last read article id

500

Unexpected database error

get /newshub/read
https://app.groupalarm.com/api/v1/newshub/read

UpsertUserReadArticles

Updates the read articles for the current user

Request Body schema: application/json
Array
int64

Responses

200

last read article successfully updated

500

Unexpected database error

put /newshub/read
https://app.groupalarm.com/api/v1/newshub/read

Request samples

application/json
Copy
Expand all Collapse all
[
  • null
]

AddUserReadArticle

Adds the passed article id to the read articles for this user

path Parameters
id
required
int64

id of the read article that should be added for this user

Responses

200

article id was successfully added to read articles

500

Unexpected database error

put /newshub/read/{id}
https://app.groupalarm.com/api/v1/newshub/read/{id}

GetUserUnreadArticlesCount

Returns the amount of unread articles for the current user

Responses

200

amount of unread articles

500

Unexpected database error

get /newshub/unread
https://app.groupalarm.com/api/v1/newshub/unread