NAME

WWW::Suffit::API - The Suffit API

VERSION

API Version 1.03

DESCRIPTION

This library provides server API methods and describe it

MEDIA TYPES

The API currently supports only JSON as an exchange format. Be sure to set both the Content-Type and Accept headers for every request as application/json.

All Date objects are returned in ISO 8601 format: YYYY-MM-DDTHH:mm:ss.SSSZ or in unixtime format (epoch), eg.: 1682759233

CHARACTER SET

API supports a subset of the UTF-8 specification. Specifically, any character that can be encoded in three bytes or less is supported. BMP characters and supplementary characters that must be encoded using four bytes aren't supported at this time.

HTTP METHODS

Where possible, the we strives to use appropriate HTTP methods for each action.

GET

Used for retrieving objects

POST

Used for creating objects or performing custom actions (such as user lifecycle operations). For POST requests with no body param, set the Content-Length header to zero.

PUT

Used for replacing objects or collections. For PUT requests with no body param, set the Content-Length header to zero.

PATCH

Used for partially updating objects

DELETE

Used for deleting objects

IP ADDRESS

The public IP address of your application is automatically used as the client IP address for your request. The API supports the standard X-Forwarded-For HTTP header to forward the originating client's IP address if your application is behind a proxy server or acting as a sign-in portal or gateway.

Note: The public IP address of your trusted web application must be a part of the allowlist in your org's network security settings as a trusted proxy to forward the user agent's original IP address with the X-Forwarded-For HTTP header.

ERRORS

All successful requests return a 200 status if there is content to return or a 204 status if there is no content to return.

All requests that result in an error return the appropriate 4xx or 5xx error code with a custom JSON error object:

{
  "code": "E0001",
  "error": "API validation failed",
  "status": false
}

or

{
  "code": "E0001",
  "message": "API validation failed",
  "status": false
}
code

A code that is associated with this error type

error

A natural language explanation of the error

message

A natural language explanation of the error (=error)

status

Any errors always return the status false

List of codes see "ERROR CODES" in WWW::Suffit::API

AUTHENTICATION

Suffit APIs support two authentication options: session and tokens.

The Suffit API requires the custom HTTP authentication scheme Token or Bearer for API token authentication. Requests must have a valid API token specified in the HTTP Authorization header with the Token/Bearer scheme or HTTP X-Token header.

For example:

X-Token: 00QCjAl4MlV-WPXM...0HmjFx-vbGua
Authorization: Token 00QCjAl4MlV-WPXM...0HmjFx-vbGua
Authorization: Bearer 00QCjAl4MlV-WPXM...0HmjFx-vbGua

METHODS

This class inherits all methods from Mojo::Base and implements the following new ones

hint

my $hint = $api->hint;
my $hint = $api->hint('E1234');

Get hint by error code

ERROR CODES

List of common Suffit API error codes

E0xxx -- General API error codes

E01xx, E02xx, E03xx, E04xx and E05xx are reserved as HTTP errors

 API   | HTTP  | DESCRIPTION
-------+-------+-------------------------------------------------
 E0000   [ * ]   Ok (general)
 E0100   [100]   Continue
 E0200   [200]   OK (HTTP)
 E0300   [300]   Multiple Choices
 E0400   [400]   Bad Request
 E0500   [500]   Internal Server Error
E10xx -- Public API error codes

E1000-E1029 - authentication and authorization Suffit API error codes. See "ERROR CODES" in WWW::Suffit::Server::Auth for details

E1030-E1059 - public Suffit API error codes. See "ERROR CODES" in WWW::Suffit::Server::API for details

E11xx -- Private API error codes

E1100-E1109 - V1 Suffit API error codes. See "ERROR CODES" in WWW::Suffit::Server::API::V1 for details

E1110-E1119 - NoAPI Suffit API error codes. See "ERROR CODES" in WWW::Suffit::Server::API::NoAPI for details

E1120-E1199 - User profile Suffit API error codes. See "ERROR CODES" in WWW::Suffit::Server::API::User for details

E12xx -- Admin API error codes

E1200-E1299 - Admin Suffit API error codes. See "ERROR CODES" in WWW::Suffit::Server::API::Admin for details

E13xx -- AuthDB error codes

E1300-E1399 - AuthDB error codes. See "ERROR CODES" in WWW::Suffit::AuthDB for details

E14xx -- Error codes are reserved for future use
E15xx -- Error codes are reserved for future use
E16xx -- Error codes are reserved for future use
E17xx -- Error codes are reserved for future use
E18xx -- Error codes are reserved for future use
E19xx -- Error codes are reserved for future use
E7xxx -- Application error code

Error codes for user applications

AUTHOR

Serż Minus (Sergey Lepenkov) https://www.serzik.com <abalama@cpan.org>

COPYRIGHT

Copyright (C) 1998-2025 D&D Corporation. All Rights Reserved

LICENSE

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See LICENSE file and https://dev.perl.org/licenses/