Skip to content

Latest commit

 

History

History
345 lines (250 loc) · 12.5 KB

NotificationsApi.md

File metadata and controls

345 lines (250 loc) · 12.5 KB

NotificationsApi

All URIs are relative to https://api.mosquitoalert.com/v1

Method HTTP request Description
create POST /notifications/
list GET /notifications/
list_mine GET /me/notifications/
partial_update PATCH /notifications/{id}/
retrieve GET /notifications/{id}/
update PUT /notifications/{id}/

create

array[CreateNotification] create(meta_notification_request = var.meta_notification_request)

Example

library(MosquitoAlert)

# prepare function argument(s)
var_meta_notification_request <- MetaNotificationRequest$new("user", CreateNotificationMessageRequest$new(LocalizedFieldRequest$new("en_example", "bg_example", "bn_example", "ca_example", "de_example", "el_example", "es_example", "eu_example", "fr_example", "gl_example", "hr_example", "hu_example", "it_example", "lb_example", "mk_example", "nl_example", "pt_example", "ro_example", "sl_example", "sq_example", "sr_example", "sv_example", "tr_example", "zh-CN_example"), LocalizedFieldRequest$new("en_example", "bg_example", "bn_example", "ca_example", "de_example", "el_example", "es_example", "eu_example", "fr_example", "gl_example", "hr_example", "hu_example", "it_example", "lb_example", "mk_example", "nl_example", "pt_example", "ro_example", "sl_example", "sq_example", "sr_example", "sv_example", "tr_example", "zh-CN_example")), c("user_uuids_example"), c("topic_codes_example")) # MetaNotificationRequest |  (Optional)

api_instance <- mosquitoalert_api$new()
# Configure API key authorization: cookieAuth
api_instance$api_client$api_keys["sessionid"] <- Sys.getenv("API_KEY")
# Configure API key authorization: tokenAuth
# api_instance$api_client$api_keys["Authorization"] <- Sys.getenv("API_KEY")
# Configure HTTP bearer authorization: jwtAuth
# api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
# result <- api_instance$create(meta_notification_request = var_meta_notification_requestdata_file = "result.txt")
result <- api_instance$notifications_api$create(meta_notification_request = var_meta_notification_request)
dput(result)

Parameters

Name Type Description Notes
meta_notification_request MetaNotificationRequest [optional]

Return type

array[CreateNotification]

Authorization

cookieAuth, tokenAuth, jwtAuth

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded, multipart/form-data
  • Accept: application/json

HTTP response details

Status code Description Response headers
400 -
401 -
403 -
404 -
201 -

list

PaginatedNotificationList list(is_read = var.is_read, order_by = var.order_by, page = var.page, page_size = var.page_size)

Example

library(MosquitoAlert)

# prepare function argument(s)
var_is_read <- "is_read_example" # character |  (Optional)
var_order_by <- c("-created_at") # array[character] | Ordenado   (Optional)
var_page <- 56 # integer | A page number within the paginated result set. (Optional)
var_page_size <- 56 # integer | Number of results to return per page. (Optional)

api_instance <- mosquitoalert_api$new()
# Configure API key authorization: cookieAuth
api_instance$api_client$api_keys["sessionid"] <- Sys.getenv("API_KEY")
# Configure API key authorization: tokenAuth
# api_instance$api_client$api_keys["Authorization"] <- Sys.getenv("API_KEY")
# Configure HTTP bearer authorization: jwtAuth
# api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
# result <- api_instance$list(is_read = var_is_read, order_by = var_order_by, page = var_page, page_size = var_page_sizedata_file = "result.txt")
result <- api_instance$notifications_api$list(is_read = var_is_read, order_by = var_order_by, page = var_page, page_size = var_page_size)
dput(result)

Parameters

Name Type Description Notes
is_read character [optional]
order_by Enum [-created_at, created_at] Ordenado [optional]
page integer A page number within the paginated result set. [optional]
page_size integer Number of results to return per page. [optional]

Return type

PaginatedNotificationList

Authorization

cookieAuth, tokenAuth, jwtAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
400 -
401 -
403 -
404 -
200 -

list_mine

PaginatedNotificationList list_mine(is_read = var.is_read, order_by = var.order_by, page = var.page, page_size = var.page_size)

Get Current User's Notifications

Example

library(MosquitoAlert)

# prepare function argument(s)
var_is_read <- "is_read_example" # character |  (Optional)
var_order_by <- c("-created_at") # array[character] | Ordenado   (Optional)
var_page <- 56 # integer | A page number within the paginated result set. (Optional)
var_page_size <- 56 # integer | Number of results to return per page. (Optional)

api_instance <- mosquitoalert_api$new()
# Configure HTTP bearer authorization: jwtAuth
api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
# result <- api_instance$list_mine(is_read = var_is_read, order_by = var_order_by, page = var_page, page_size = var_page_sizedata_file = "result.txt")
result <- api_instance$notifications_api$list_mine(is_read = var_is_read, order_by = var_order_by, page = var_page, page_size = var_page_size)
dput(result)

Parameters

Name Type Description Notes
is_read character [optional]
order_by Enum [-created_at, created_at] Ordenado [optional]
page integer A page number within the paginated result set. [optional]
page_size integer Number of results to return per page. [optional]

Return type

PaginatedNotificationList

Authorization

jwtAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
400 -
401 -
403 -
404 -
200 -

partial_update

Notification partial_update(id, patched_notification_request = var.patched_notification_request)

Example

library(MosquitoAlert)

# prepare function argument(s)
var_id <- 56 # integer | A unique integer value identifying this notification.
var_patched_notification_request <- PatchedNotificationRequest$new("is_read_example") # PatchedNotificationRequest |  (Optional)

api_instance <- mosquitoalert_api$new()
# Configure API key authorization: cookieAuth
api_instance$api_client$api_keys["sessionid"] <- Sys.getenv("API_KEY")
# Configure API key authorization: tokenAuth
# api_instance$api_client$api_keys["Authorization"] <- Sys.getenv("API_KEY")
# Configure HTTP bearer authorization: jwtAuth
# api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
# result <- api_instance$partial_update(var_id, patched_notification_request = var_patched_notification_requestdata_file = "result.txt")
result <- api_instance$notifications_api$partial_update(var_id, patched_notification_request = var_patched_notification_request)
dput(result)

Parameters

Name Type Description Notes
id integer A unique integer value identifying this notification.
patched_notification_request PatchedNotificationRequest [optional]

Return type

Notification

Authorization

cookieAuth, tokenAuth, jwtAuth

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded, multipart/form-data
  • Accept: application/json

HTTP response details

Status code Description Response headers
400 -
401 -
403 -
404 -
200 -

retrieve

Notification retrieve(id)

Example

library(MosquitoAlert)

# prepare function argument(s)
var_id <- 56 # integer | A unique integer value identifying this notification.

api_instance <- mosquitoalert_api$new()
# Configure API key authorization: cookieAuth
api_instance$api_client$api_keys["sessionid"] <- Sys.getenv("API_KEY")
# Configure API key authorization: tokenAuth
# api_instance$api_client$api_keys["Authorization"] <- Sys.getenv("API_KEY")
# Configure HTTP bearer authorization: jwtAuth
# api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
# result <- api_instance$retrieve(var_iddata_file = "result.txt")
result <- api_instance$notifications_api$retrieve(var_id)
dput(result)

Parameters

Name Type Description Notes
id integer A unique integer value identifying this notification.

Return type

Notification

Authorization

cookieAuth, tokenAuth, jwtAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
401 -
403 -
404 -
200 -

update

Notification update(id, notification_request)

Example

library(MosquitoAlert)

# prepare function argument(s)
var_id <- 56 # integer | A unique integer value identifying this notification.
var_notification_request <- NotificationRequest$new("is_read_example") # NotificationRequest | 

api_instance <- mosquitoalert_api$new()
# Configure API key authorization: cookieAuth
api_instance$api_client$api_keys["sessionid"] <- Sys.getenv("API_KEY")
# Configure API key authorization: tokenAuth
# api_instance$api_client$api_keys["Authorization"] <- Sys.getenv("API_KEY")
# Configure HTTP bearer authorization: jwtAuth
# api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
# result <- api_instance$update(var_id, var_notification_requestdata_file = "result.txt")
result <- api_instance$notifications_api$update(var_id, var_notification_request)
dput(result)

Parameters

Name Type Description Notes
id integer A unique integer value identifying this notification.
notification_request NotificationRequest

Return type

Notification

Authorization

cookieAuth, tokenAuth, jwtAuth

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded, multipart/form-data
  • Accept: application/json

HTTP response details

Status code Description Response headers
400 -
401 -
403 -
404 -
200 -