# NamSor API v2
#
# NamSor API v2 : enpoints to process personal names (gender, cultural origin or ethnicity) in all alphabets or languages. Use GET methods for small tests, but prefer POST methods for higher throughput (batch processing of up to 100 names at a time). Need something you can't find here? We have many more features coming soon. Let us know, we'll do our best to add it!
#
# The version of the OpenAPI document: 2.0.10
# Contact: contact@namsor.com
# Generated by: https://openapi-generator.tech
#' @docType class
#' @title Social operations
#' @description namsor.Social
#' @format An \code{R6Class} generator object
#' @field apiClient Handles the client-server communication.
#'
#' @section Methods:
#' \describe{
#' \strong{ PhoneCode } \emph{ [USES 11 UNITS PER NAME] Infer the likely country and phone prefix, given a personal name and formatted / unformatted phone number. }
#'
#'
#' \itemize{
#' \item \emph{ @param } first.name character
#' \item \emph{ @param } last.name character
#' \item \emph{ @param } phone.number character
#' \item \emph{ @returnType } \link{FirstLastNamePhoneCodedOut} \cr
#'
#'
#' \item status code : 200 | A name with country and phone code.
#'
#' \item return type : FirstLastNamePhoneCodedOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 403 | API Limit Reached or API Key Disabled
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PhoneCodeBatch } \emph{ [USES 11 UNITS PER NAME] Infer the likely country and phone prefix, of up to 100 personal names, detecting automatically the local context given a name and formatted / unformatted phone number. }
#'
#'
#' \itemize{
#' \item \emph{ @param } batch.first.last.name.phone.number.in \link{BatchFirstLastNamePhoneNumberIn}
#' \item \emph{ @returnType } \link{BatchFirstLastNamePhoneCodedOut} \cr
#'
#'
#' \item status code : 200 | A list of genderized names.
#'
#' \item return type : BatchFirstLastNamePhoneCodedOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 403 | API Limit Reached or API Key Disabled
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PhoneCodeGeo } \emph{ [USES 11 UNITS PER NAME] Infer the likely phone prefix, given a personal name and formatted / unformatted phone number, with a local context (ISO2 country of residence). }
#'
#'
#' \itemize{
#' \item \emph{ @param } first.name character
#' \item \emph{ @param } last.name character
#' \item \emph{ @param } phone.number character
#' \item \emph{ @param } country.iso2 character
#' \item \emph{ @returnType } \link{FirstLastNamePhoneCodedOut} \cr
#'
#'
#' \item status code : 200 | A name with country and phone code.
#'
#' \item return type : FirstLastNamePhoneCodedOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 403 | API Limit Reached or API Key Disabled
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PhoneCodeGeoBatch } \emph{ [USES 11 UNITS PER NAME] Infer the likely country and phone prefix, of up to 100 personal names, with a local context (ISO2 country of residence). }
#'
#'
#' \itemize{
#' \item \emph{ @param } batch.first.last.name.phone.number.geo.in \link{BatchFirstLastNamePhoneNumberGeoIn}
#' \item \emph{ @returnType } \link{BatchFirstLastNamePhoneCodedOut} \cr
#'
#'
#' \item status code : 200 | A list of genderized names.
#'
#' \item return type : BatchFirstLastNamePhoneCodedOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 403 | API Limit Reached or API Key Disabled
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PhoneCodeGeoFeedbackLoop } \emph{ [CREDITS 1 UNIT] Feedback loop to better infer the likely phone prefix, given a personal name and formatted / unformatted phone number, with a local context (ISO2 country of residence). }
#'
#'
#' \itemize{
#' \item \emph{ @param } first.name character
#' \item \emph{ @param } last.name character
#' \item \emph{ @param } phone.number character
#' \item \emph{ @param } phone.number.e164 character
#' \item \emph{ @param } country.iso2 character
#' \item \emph{ @returnType } \link{FirstLastNamePhoneCodedOut} \cr
#'
#'
#' \item status code : 200 | A name with country and phone code.
#'
#' \item return type : FirstLastNamePhoneCodedOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 403 | API Limit Reached or API Key Disabled
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' }
#'
#'
#' @examples
#' \dontrun{
#' #################### PhoneCode ####################
#'
#' library(namsor)
#' var.first.name <- 'first.name_example' # character |
#' var.last.name <- 'last.name_example' # character |
#' var.phone.number <- 'phone.number_example' # character |
#'
#' #[USES 11 UNITS PER NAME] Infer the likely country and phone prefix, given a personal name and formatted / unformatted phone number.
#' api.instance <- SocialApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$PhoneCode(var.first.name, var.last.name, var.phone.number)
#'
#'
#' #################### PhoneCodeBatch ####################
#'
#' library(namsor)
#' var.batch.first.last.name.phone.number.in <- BatchFirstLastNamePhoneNumberIn$new() # BatchFirstLastNamePhoneNumberIn | A list of personal names
#'
#' #[USES 11 UNITS PER NAME] Infer the likely country and phone prefix, of up to 100 personal names, detecting automatically the local context given a name and formatted / unformatted phone number.
#' api.instance <- SocialApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$PhoneCodeBatch(batch.first.last.name.phone.number.in=var.batch.first.last.name.phone.number.in)
#'
#'
#' #################### PhoneCodeGeo ####################
#'
#' library(namsor)
#' var.first.name <- 'first.name_example' # character |
#' var.last.name <- 'last.name_example' # character |
#' var.phone.number <- 'phone.number_example' # character |
#' var.country.iso2 <- 'country.iso2_example' # character |
#'
#' #[USES 11 UNITS PER NAME] Infer the likely phone prefix, given a personal name and formatted / unformatted phone number, with a local context (ISO2 country of residence).
#' api.instance <- SocialApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$PhoneCodeGeo(var.first.name, var.last.name, var.phone.number, var.country.iso2)
#'
#'
#' #################### PhoneCodeGeoBatch ####################
#'
#' library(namsor)
#' var.batch.first.last.name.phone.number.geo.in <- BatchFirstLastNamePhoneNumberGeoIn$new() # BatchFirstLastNamePhoneNumberGeoIn | A list of personal names
#'
#' #[USES 11 UNITS PER NAME] Infer the likely country and phone prefix, of up to 100 personal names, with a local context (ISO2 country of residence).
#' api.instance <- SocialApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$PhoneCodeGeoBatch(batch.first.last.name.phone.number.geo.in=var.batch.first.last.name.phone.number.geo.in)
#'
#'
#' #################### PhoneCodeGeoFeedbackLoop ####################
#'
#' library(namsor)
#' var.first.name <- 'first.name_example' # character |
#' var.last.name <- 'last.name_example' # character |
#' var.phone.number <- 'phone.number_example' # character |
#' var.phone.number.e164 <- 'phone.number.e164_example' # character |
#' var.country.iso2 <- 'country.iso2_example' # character |
#'
#' #[CREDITS 1 UNIT] Feedback loop to better infer the likely phone prefix, given a personal name and formatted / unformatted phone number, with a local context (ISO2 country of residence).
#' api.instance <- SocialApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$PhoneCodeGeoFeedbackLoop(var.first.name, var.last.name, var.phone.number, var.phone.number.e164, var.country.iso2)
#'
#'
#' }
#' @importFrom R6 R6Class
#' @importFrom base64enc base64encode
#' @export
SocialApi <- R6::R6Class(
'SocialApi',
public = list(
apiClient = NULL,
initialize = function(apiClient){
if (!missing(apiClient)) {
self$apiClient <- apiClient
}
else {
self$apiClient <- ApiClient$new()
}
},
PhoneCode = function(first.name, last.name, phone.number, ...){
apiResponse <- self$PhoneCodeWithHttpInfo(first.name, last.name, phone.number, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
PhoneCodeWithHttpInfo = function(first.name, last.name, phone.number, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`first.name`)) {
stop("Missing required parameter `first.name`.")
}
if (missing(`last.name`)) {
stop("Missing required parameter `last.name`.")
}
if (missing(`phone.number`)) {
stop("Missing required parameter `phone.number`.")
}
urlPath <- "/api2/json/phoneCode/{firstName}/{lastName}/{phoneNumber}"
if (!missing(`first.name`)) {
urlPath <- gsub(paste0("\\{", "firstName", "\\}"), URLencode(as.character(`first.name`), reserved = TRUE), urlPath)
}
if (!missing(`last.name`)) {
urlPath <- gsub(paste0("\\{", "lastName", "\\}"), URLencode(as.character(`last.name`), reserved = TRUE), urlPath)
}
if (!missing(`phone.number`)) {
urlPath <- gsub(paste0("\\{", "phoneNumber", "\\}"), URLencode(as.character(`phone.number`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "FirstLastNamePhoneCodedOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
PhoneCodeBatch = function(batch.first.last.name.phone.number.in=NULL, ...){
apiResponse <- self$PhoneCodeBatchWithHttpInfo(batch.first.last.name.phone.number.in, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
PhoneCodeBatchWithHttpInfo = function(batch.first.last.name.phone.number.in=NULL, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (!missing(`batch.first.last.name.phone.number.in`)) {
body <- `batch.first.last.name.phone.number.in`$toJSONString()
} else {
body <- NULL
}
urlPath <- "/api2/json/phoneCodeBatch"
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "POST",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "BatchFirstLastNamePhoneCodedOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
PhoneCodeGeo = function(first.name, last.name, phone.number, country.iso2, ...){
apiResponse <- self$PhoneCodeGeoWithHttpInfo(first.name, last.name, phone.number, country.iso2, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
PhoneCodeGeoWithHttpInfo = function(first.name, last.name, phone.number, country.iso2, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`first.name`)) {
stop("Missing required parameter `first.name`.")
}
if (missing(`last.name`)) {
stop("Missing required parameter `last.name`.")
}
if (missing(`phone.number`)) {
stop("Missing required parameter `phone.number`.")
}
if (missing(`country.iso2`)) {
stop("Missing required parameter `country.iso2`.")
}
urlPath <- "/api2/json/phoneCodeGeo/{firstName}/{lastName}/{phoneNumber}/{countryIso2}"
if (!missing(`first.name`)) {
urlPath <- gsub(paste0("\\{", "firstName", "\\}"), URLencode(as.character(`first.name`), reserved = TRUE), urlPath)
}
if (!missing(`last.name`)) {
urlPath <- gsub(paste0("\\{", "lastName", "\\}"), URLencode(as.character(`last.name`), reserved = TRUE), urlPath)
}
if (!missing(`phone.number`)) {
urlPath <- gsub(paste0("\\{", "phoneNumber", "\\}"), URLencode(as.character(`phone.number`), reserved = TRUE), urlPath)
}
if (!missing(`country.iso2`)) {
urlPath <- gsub(paste0("\\{", "countryIso2", "\\}"), URLencode(as.character(`country.iso2`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "FirstLastNamePhoneCodedOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
PhoneCodeGeoBatch = function(batch.first.last.name.phone.number.geo.in=NULL, ...){
apiResponse <- self$PhoneCodeGeoBatchWithHttpInfo(batch.first.last.name.phone.number.geo.in, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
PhoneCodeGeoBatchWithHttpInfo = function(batch.first.last.name.phone.number.geo.in=NULL, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (!missing(`batch.first.last.name.phone.number.geo.in`)) {
body <- `batch.first.last.name.phone.number.geo.in`$toJSONString()
} else {
body <- NULL
}
urlPath <- "/api2/json/phoneCodeGeoBatch"
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "POST",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "BatchFirstLastNamePhoneCodedOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
PhoneCodeGeoFeedbackLoop = function(first.name, last.name, phone.number, phone.number.e164, country.iso2, ...){
apiResponse <- self$PhoneCodeGeoFeedbackLoopWithHttpInfo(first.name, last.name, phone.number, phone.number.e164, country.iso2, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
PhoneCodeGeoFeedbackLoopWithHttpInfo = function(first.name, last.name, phone.number, phone.number.e164, country.iso2, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`first.name`)) {
stop("Missing required parameter `first.name`.")
}
if (missing(`last.name`)) {
stop("Missing required parameter `last.name`.")
}
if (missing(`phone.number`)) {
stop("Missing required parameter `phone.number`.")
}
if (missing(`phone.number.e164`)) {
stop("Missing required parameter `phone.number.e164`.")
}
if (missing(`country.iso2`)) {
stop("Missing required parameter `country.iso2`.")
}
urlPath <- "/api2/json/phoneCodeGeoFeedbackLoop/{firstName}/{lastName}/{phoneNumber}/{phoneNumberE164}/{countryIso2}"
if (!missing(`first.name`)) {
urlPath <- gsub(paste0("\\{", "firstName", "\\}"), URLencode(as.character(`first.name`), reserved = TRUE), urlPath)
}
if (!missing(`last.name`)) {
urlPath <- gsub(paste0("\\{", "lastName", "\\}"), URLencode(as.character(`last.name`), reserved = TRUE), urlPath)
}
if (!missing(`phone.number`)) {
urlPath <- gsub(paste0("\\{", "phoneNumber", "\\}"), URLencode(as.character(`phone.number`), reserved = TRUE), urlPath)
}
if (!missing(`phone.number.e164`)) {
urlPath <- gsub(paste0("\\{", "phoneNumberE164", "\\}"), URLencode(as.character(`phone.number.e164`), reserved = TRUE), urlPath)
}
if (!missing(`country.iso2`)) {
urlPath <- gsub(paste0("\\{", "countryIso2", "\\}"), URLencode(as.character(`country.iso2`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "FirstLastNamePhoneCodedOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.