Application Programming Interface

This RESTful API provides the building blocks that developers need to programmatically integrate Easy 0 with other network elements and systems. The API works over HTTP or HTTPS.

Individual objects that can be manipulated through the API include Easy 0 administrators, service providers, and more. This chapter is a developer reference for connecting a currently used system to Easy 0.

The API is available at https://<NIU or HA address>/easy0/api.

Note

For more information about JSON, see http://json.org/


URI Scheme

The following shows the base URI and the format used by the API:

Base URI: <niu-ha>/easy0/api

Where niu-ha is the host address of the primary NIU.

Following the base URI, the scope and scope ID are added to show which role the actions are to be completed as.

URI Format: /<object>

Many objects will use the following URI: /<object>/<service_provider>


Methods

The API uses the following methods:

  • GET: Access a resource

  • PUT: Create or modify a resource

  • POST: Create a resource

Note

The POST method can be used to import and export data. For more information, see Provisioning.

  • DELETE: Delete a resource

Note

The DELETE method can be used to archive and purge data. For more information, see Archiving, Restoring, and Purging Data.


Logging In to the API

POST to <base_uri>/authenticate with the username and password parameters.

For example:

curl -X POST \
         -H "Content-Type:application/json" \
         <niu-ha>/easy0/api/authenticate \
         -d '{"username":"<username>","password":"<password>"}'

The response will contain the following:

"data": [
        {"token": "<secure-access-token>"}
        ],
"jsonapi": {"version": "2.0-3",
"name": "Easy Zero",
"short_name": "easy0",
"author": "IMSWorkX, Inc."

The secure access token must be passed back as the value of the Authorization header. For example:

Authorization: Basic <secure-access-token>

Note

Tokens expire after 24 hours.


Accessing an Object

URI Format: <niu-ha>/easy0/api/<json-api-version>/<object>/<object-id>

curl -X GET \
         -H  "Content-Type:application/json" \
         -H "Authorization:Basic <secure-access-token>" \
         "http://localhost/easy0/api/service_provider/IMSWorkX"

This GET command will provide a 200 message if the specified object exists:

{
        "meta": {
                "scope": "success",
                "code": "200",
                "records_page_size": "request.parameters.limit",
                "archive": "request.parameters.archive",
                "records_page_offset": "request.parameters.offset"
        },
        "data": [
                {
                        "scope": "number",
                        "meta": {
                                "modified_by": "<string>",
                                "modified": "<datetime>",
                                "created_by": "<string>",
                                "created": "<datetime>"
                        },
                        "attributes": {
                                "rules": "<array>",
                                "timezone": "<string>",
                                "number": "<string>",
                                "subscriber_name": "<string>"
                        }
                }
        ]
}

Table Queries

Tables are lists of objects that can be accessed and modified to affect multiple objects at once.

URI Format: <niu-ha>/easy0/api/<object>?<optionalparameters>

Table queries may contain the following parameters, all of which are optional:

{
        "sort": {},
        "search": {},
        "like": {},
        "sort_function": {},
        "icontains": {},
        "limit": {},
        "offset": {}
}
sort

A string that defines how a column is ordered. Accepted values are ‘<column_name> ASC’ to be sorted by ascending value or ‘<column_name> DES’ to be sorted by descending value.

search

A string that is a comma-separated sequence of parameters to search by. There are two formats: ‘:string’ and ‘::’ where the first represents a string search (for example, ‘first_name:Bill’ would find any person with a first name of Bill) and the second represents a between search (for example, ‘customer_number:1000:2000’ would find all records with customer numbers between, but not including, 1000 and 2000). Note that this can also be a datetime object in ISO format.

like

A string that denotes a value to perform a ‘like’ search. This will perform a substring search on any string fields in the object and return if any of these fields are a partial match.

sort_function

A string that overrides ‘sort’. Pass in ::{:}*.

icontains

A string that is a case insensitive ‘contains’ search. Similar to the ‘search’ parameter, you should pass in a comma-separated list of ‘:string’. Exact search takes precedence. The field being searched must be a string-type variable.

limit

An integer that is the number of records to retrieve at a time. The default value is 10.

offset

An integer that is the number of records to skip from the beginning. The default value is 0.

An example CDR query:

curl -X GET \
         -H  "Content-Type:application/json" \
         -H "Authorization:Basic <secure-access-token>" \
         "http://localhost/easy0/api/cdr"?offset=0&limit=25&sort=column:asc

Call Detail Records

The following information is returned after a request to retrieve Call Detail Records (CDRs).

{
        "original_called_number": "<string>",
        "called_number": "<string>",
        "switch_point_code": "<string>",
        "calling_number": "<string>",
        "start_time": "<timestamp>",
        "end_time": "<timestamp>",
        "service_provider_name": "<string>",
        "route": "<object>",
        "cdrs": "<array>"
}

Endpoints

/easy0/api/easy0_cdr

GET - Retrieve all CDRs that match the specified criteria.

/easy0/api/easy0_cdr/{service_provider}

GET - Retrieve the CDRs associated with a particular Service Provider.


Creating an Object

Use the POST command without specifying an object ID to create an object. At this time, the object will be given an object ID that can be modified later.

For example:

curl -X POST \
         -H "Content-Type:application/json" \
         -H "Authorization:Basic <secure-access-token>" \
         <ha_address>/easy0/api/service_provider -d \
         '{"name": "IMSWorkX", "display_name": "IMSWorkX", "first_name": "Jane", "last_name": "Doe", "email": "example@example.com", "address": "1 Main St. Rochester, NY", "phone": "5858675309", "notes": "more notes"}'

This example POST command will add a new Service Provider named IMSWorkX.


Modifying an Object

When the PUT command is used and the object ID is included in the command, the object is modified.

For example:

curl -X PUT \
         -H "Content-Type:application/json" \
         -H "Authorization:Basic <secure-access-token>" \
         <ha_address>/easy0/api/service_provider/IMSWorkX -d \
         '{"first_name": "John", "last_name": "Smith"}'

This example PUT command will change the name of the Service Provider from Jane Doe to John Smith.

Object Definitions

administrator

The following information is used in the body of a request to create and edit different administrator level users.

{
        "username": "John_Doe_admin",
        "role_id": "service_provider:exampleserviceprovider",
        "first_name": "John",
        "last_name": "Doe",
        "email": "jdoe@example.com",
        "permissions": "default:service_provider"
}
username

A unique string that is the user name for this user. Limit of 64 characters. Can contain only lowercase characters, numbers, or underscores.

role_id

A string that defines the type of administrator that is being created. Accepted values are:

  • platform_owner

  • service_provider:<service_provider_name>

first_name (optional)

A string that is the first name of this user. Limit of 250 characters.

last_name (optional)

A string that is the last name of this user. Limit of 250 characters.

email (optional)

A string that is the email address for this user. Limit of 250 characters.

permissions (optional)

An array of permission groups that this user is a member of. Permissions are dependent on the specified role_id of the created administrator.

  • easy0_platform_administrator_provision

  • easy0_platform_administrator_view

  • easy0_platform_administrator_edit

  • easy0_service_provider_provision

  • easy0_service_provider_view

  • easy0_service_provider_edit

  • easy0_service_provision

  • easy0_service_view

  • easy0_service_edit

  • easy0_call_pattern_provision

  • easy0_call_pattern_view

  • easy0_call_pattern_edit

  • easy0_service_administrator_provision

  • easy0_service_administrator_view

  • easy0_service_administrator_edit

  • easy0_settings_view

  • easy0_settings_edit

  • easy0_statistics_view

Endpoints

/easy0/api/administrator/{role_id}

GET - Retrieve all administrators with the specified role.

POST - Create an administrator with the specified role.

/easy0/api/administrator/{role_id}/{username}

GET - Retrieve the administrator with the specified role and user name.

PUT - Modify the administrator if it exists, otherwise create the administrator.

DELETE - Archive the specified administrator.

/easy0/api/administrator/{role_id}/{username}/reset

POST - Reset this user’s password, returning a reset token.

service_provider

The following information is used in the body of a request to create and edit different Service Providers.

Note

These are not administrator accounts.

{
        "name": "exampleserviceprovider",
        "display_name": "JSMITH",
        "point_codes": "[]",
        "via": "[]",
        "first_name": "John",
        "last_name": "Smith",
        "email": "jsmith@example.com",
        "address": "123 Main St",
        "phone": "5851231234",
        "timezone": "gmt",
        "notes": "Any string here"
}
name

A unique string that is the name of this Service Provider. Limit of 64 characters.

display_name (optional)

An unconstrained string used as a display name. Limit of 250 characters.

point_codes (optional)

An array of strings that are the point codes associated with this Service Provider.

via (optional)

An array of strings that are the SIP Via headers associated with this Service Provider.

first_name (optional)

A string that is the first name of a contact for this Service Provider. Limit of 250 characters.

last_name (optional)

A string that is the last name of a contact for this Service Provider. Limit of 250 characters.

email (optional)

A string that is the email address of this Service Provider, where notifications and password reset requests will be sent. Limit of 250 characters.

address (optional)

A string that is the physical address of this Service Provider. Limit of 250 characters.

phone (optional)

A string that is the primary phone number of this Service Provider. Limit of 250 characters.

timezone

A string that is the time zone used by this Service Provider.

notes (optional)

A string that is a free-form notes field. Limit of 2048 characters.

Endpoints

/easy0/api/service_provider

GET - Retrieve all Service Providers.

POST - Create a new Service Provider.

/easy0/api/service_provider/{name}

GET - Retrieve the Service Provider with the specified name.

PUT - Modify the Service Provider if it exists, otherwise create the Service Provider.

DELETE - Archive the specified Service Provider.

audio

The following information is used in the body of a request to create and edit audio files.

{
        "file": "example.wav",
        "location": "/tmp/audio",
        "server": "lab-niu01.lab.redcom.com",
        "label": "example",
        "service_provider_name": "exampleserviceprovider"
}
file

A string that is the name of the audio file. This must be a .wav file. While searching for all files, can use a regex match “^.*?.wav$”.

label (optional)

A string that is a nickname or label to help identify this audio file.

location

A string that is the exact location of the audio file.

server

A string that is the server (NIU or secondary) where the audio file is stored.

service_provider_name

A unique string that is the Service Provider who uses this audio file. Must match an existing Service Provider.

Endpoints

/easy0/api/audio/{service_provider_name}

GET - Retrieve all audio files for the specified Service Provider.

POST - Create a new audio file for the specified Service Provider.

/easy0/api/audio/{service_provider_name}/{file}

GET - Retrieve the specified audio file.

PUT - Modify the file if it exists, otherwise create the file.

DELETE - Archive the specified audio file.

call_plan

The following information is used in the body of a request to create and edit call plans.

{
        "name": "examplecallplan",
        "display_name": "Example",
        "rules": "[]",
        "priority": "1",
        "service_provider_name": "exampleserviceprovider"
}
name

A string that is the name of this call plan. This value must be at least 6 characters and no more than 64 characters.

display_name (optional)

An unconstrained string used as a display name. Limit of 250 characters.

rules (optional)

An array of additional routing rules applied to this call plan.

priority

An integer that is the priority of this call plan. Call plans are evaluated by the routing engine in ascending order.

service_provider_name

A unique string that is the Service Provider who owns this call plan. Must match an existing Service Provider.

Endpoints

/easy0/api/call_plan/{service_provider_name}

GET - Retrieve all call plans for the specified Service Provider.

POST - Create a new call plan for the specified Service Provider.

/easy0/api/call_plan/{service_provider_name}/{name}

GET - Retrieve the specified call plan.

PUT - Modify the call plan if is exists, otherwise create the call plan.

DELETE - Archive the specified call plan.

service_key

The following information is used in the body of a request to create and edit Caller Name Delivery (CNAM) service keys. CNAM is used to provide name identification of the calling party, which is displayed in the Caller ID information.

{
        "type_of_digits": "ROUTING_NUMBER",
        "nature_of_number": "NATIONAL_NUM_PRES_ALLOWED",
        "numbering_plan": "UNKNOWN_NOT_APPLICABLE",
        "encoding_scheme": "IA5",
        "digits": "1234",
        "service_provider_name": "serviceprovider",
        "priority": "2",
        "id": "1"
}
type_of_digits

A string that defines what the digits represent. Accepted values are:

  • NOT_USED

  • CALLED_PARTY_NUM_DIALED

  • CALLING_PARTY_NUM_ANI

  • CALLER_INTERACTION

  • ROUTING_NUMBER

  • BILLING_NUMBER

  • DESTINATION_NUMBER

  • LATA

  • CARRIER

  • LAST_CALLING_PARTY

  • LAST_PARTY_CALLED

  • CALLING_DIRECTORY_NUMBER

  • VMSR_IDENTIFIER

  • ORIGINAL_CALLED_NUMBER

  • REDIRECTING_NUMBER

  • CONNECTED_NUMBER

nature_of_number

A string that defines whether the number is national or international and whether number presentation is allowed. Accepted values are:

  • NATIONAL_NUM_PRES_ALLOWED

  • NATIONAL_NUM_PRES_RESTRICTED

  • INTERNATIONAL_NUM_PRES_ALLOWED

  • INTERNATIONAL_NUM_PRES_RESTRICTED

numbering_plan

A string that is the type of numbering plan to use. Accepted values are:

  • UNKNOWN_NOT_APPLICABLE

  • ISDN_NUMBERING_PLAN

  • TELEPHONY_NUMBERING_PLAN

  • DATA_NUMBERING_PLAN

  • TELEX_NUMBERING_PLAN

  • MARITIME_MOBILE_NUMBERING_PLAN

  • LAND_MOBILE_NUMBERING_PLAN

  • PRIVATE_NUMBERING_PLAN

encoding_scheme

A string that is the type of encoding to use. Accepted values are “BCD” or “IA5”.

digits

A string that is the digits for this service key.

service_provider_name

A unique string that is the Service Provider who owns this service key. Must match an existing Service Provider.

priority

An integer that is the priority of this service key. Service keys are added in ascending order.

id

An integer that is the autoincrementing ID for this service key.

Endpoints

/easy0/api/service_key/{service_provider_name}

GET - Retrieve all service keys for the specified Service Provider.

POST - Create a new service key for the specified Service Provider.

/easy0/api/service_key/{service_provider_name}/{id}

GET - Retrieve the specified service key.

PUT - Modify the service key if is exists, otherwise create the service key.

DELETE - Archive the specified service key.


Settings

The following information is used in the body of a request to edit settings. The following example uses the default values.

{
        "routing_engine_uri": "http://niu/easy0-routing-engine",
        "menu_forwarding_configuration_file": "/usr/sipxpress/config/easy0-menu-forwarding-configuration.yml",
        "download_directory": "/var/opt/xpressworkx/app-manager/easy0/media/download",
        "upload_directory": "/var/opt/xpressworkx/app-manager/easy0/media/upload",
        "job_log_directory": "/var/opt/xpressworkx/app-manager/easy0/media/download",
        "default_route_on": "5",
        "application_username": "easy0_application_manager",
        "application_password": "im5_wrkX",
        "routing_interface_impl": "com.imsworkx.routingEngine.callflow.HttpClient",
        "menu_destination": "12345",
        "csr_location": "",
        "use_contact": true,
        "branding": {
                "imsworkx": {
                        "color_hue": "202",
                        "highlight_hue": "198",
                        "logo": "logo.png",
                        "label": "Evolve Cellular Inc. &reg;"
                }
        },
        "restworkx": {
                "archive_max_days": "7",
                "audit_log_directory": "/var/opt/xpressworkx/app-manager/easy0/logs/audit-logs/",
                "log_duration": "1"
        },
        "web_settings": {
                "help_page": "http://www.imsworkx.com",
                "password_length": "8",
                "number_mask": "{+DDD} (DDD) DDD-DDDD",
                "audio_package": "imsworkx"
        },
        "routing_engine": {
                "egress_route": "",
                "default_no_route_behavior": "404",
                "redirect_address": "",
                "point_code_format": "ansi",
                "sip_routing_prefix": "",
                "sip_connection_type": "redirect",
                "sip_play_media_on_error": false,
                "refer_timeout": 30
        },
        "easy0": {
                "lidb_lookup": false,
                "global_title_indicator": 2,
                "translation_type": 253,
                "global_title_digits": "",
                "subsystem_bit": 1,
                "signal_point_code_bit": 0,
                "routing_bit": 0,
                "natl_intl_bit": 1,
                "subsystem_number": 0,
                "point_code": 0
        },
        "security": {
                "client_cert": null,
                "client_key": null,
                "ca_bundle": null,
                "allow_insecure": false
        },
        "email_settings": {
                "use_email": false,
                "host": "",
                "user": "",
                "port": "",
                "password": "",
                "use_tls": false,
                "messages": {
                        "recover": {
                                "subject": "Recover Your Account",
                                "headline": "Account Recovery",
                                "message": "Click the link below to recover your account."
                        },
                        "activate": {
                                "subject": "Activate Your Account",
                                "headline": "Account Activation",
                                "message": "Click the link below to activate your account."
                        }
                }
        }
}

The following settings are set automatically during installation and should not need to be changed:

  • menu_forwarding_configuration_file

  • routing_engine_uri

  • download_directory

  • upload_directory

  • job_log_directory

  • application_username

  • application_password

branding

Contains settings related to the look and feel of the website using the following parameters:

imsworkx: The default appearance settings. Additional fields can be added at this level under different names, which can then be appended to the URL for custom branding.

color_hue: (Integer) This will change the primary color used on the site. This value is a number between 0 and 360, using the HSL model where 0 is red, 120 is green, and 240 is blue.

highlight_hue: (Integer) This will change the secondary color used on the site. This value is a number between 0 and 360, using the HSL model where 0 is red, 120 is green, and 240 is blue.

logo: (String) Filename for the logo that will appear in the upper, left corner of the website. The image must be a PNG file and placed in the /var/opt/xpressworkx/app-manager/easy0/static/img/ directory.

label: (String) The message displayed in the upper, right corner of the website. This is generally a company name.

restworkx

Contains settings related to the platform and database.

archive_max_days: (Integer) Number of days to keep records in the archive table.

log_duration: (Integer) Number of days before rotating the log file.

audit_log_directory: (String) Should not be changed.

web_settings

Contains settings for elements on the website.

help_page: (String) URL for the web page that is linked in the “Help” button on the upper, right corner of the page.

password_length: (Integer) Minimum number of characters allowed in a password.

number_mask: (String) Determines how phone numbers appear. Lowercase ‘d’ represents a digit 0-9. Uppercase ‘D’ represents a digit 0-9 or an ‘X’ (denoting any digit). A lowercase ‘x’ denotes any character. Braces ({}) denote an optional grouping that will only be filled after all other groupings are filled. All other characters are taken literally as they are written but are not taken as part of the value when saving. Treat these as visual separators only.

audio_package: (String) The prompt set that will be used in the web UI.

routing_engine

Contains settings used to determine call flow.

egress_route: (String) The host to use when connecting a call to the called party.

default_no_route_behavior: (String) The default behavior for SIP calls when no route is found for the call. The options available directly correspond to SIP final response codes.

redirect_address: (String) The address a SIP redirect message will be sent.

point_code_format: (String: “ansi”, “itu”) The format that point codes will be in.

sip_routing_prefix: (String) A prefix value added to the call during the call processing.

sip_connection_type: (String) The type of SIP connection.

sip_play_media_on_error: (String) The sounds a subscriber will hear as the called party is answering.

refer_timeout: (Integer)

easy0

Contains settings specific to the Easy 0 service.

lidb_lookup: (Boolean) Determines whether the line information database (LIDB) is queried to retrieve Caller Name Delivery (CNAM) data and use it for caller ID services.

global_title_indicator: (Integer) The global title indicator to determine whether a global title is present and, if one is, whether it includes the translation type, numbering plan, encoding scheme or nature of address indicator. If set to 0, a global title is not included in the address.

translation_type: (Integer) The translation type used to direct the message to the appropriate translator.

global_title_digits: (Integer) The global title destination digits used for routing messages depending on the selected translation type.

subsystem_bit: (Integer) The bit determining whether a subsystem number is included in the address. If set to 1, a subsystem number is included. If set to 0, a subsystem number is not included.

signal_point_code_bit: (Integer) The bit determining whether a signaling point code is included in the address. If set to 1, a signaling point code is included. If set to 0, a signaling point code is not included.

routing_bit: (Integer) The bit determining which address element is to be used for routing. If set to 0, the global title will be used for routing. If set to 1, the subsystem number will be used for routing.

natl_intl_bit: (Integer) The bit determining whether the routing is national or international. If set to 0, the routing is international. If set to 1, the routing is national.

subsystem_number: (Integer) The subsystem number (SSN) used for routing messages depending on the selected translation type.

point_code: (Integer) The signaling point code used for routing messages depending on the selected translation type.

security

Contains settings related to SSL configuration.

client_cert: (String) File location of the client’s certificate.

client_key: (String) File location of the key used for the client’s certificate.

ca_bundle: (String) File location of the root certificate. This is the only setting that matters when SSL is configured by the configure-ssl command and is automatically set by that script.

allow_insecure: (Boolean) If true, the web UI will not check the NIU’s certificate against the configured ca_bundle when making API calls.

email_settings

Contains settings for automated email messages for password changes.

use_email: (Boolean) If true, activation and recovery email messages will be sent.

host: (String) Host for email client to send messages through.

user: (String) Username for email service that messages will be sent through.

port: (Integer) Port used for email host.

password: (String) Password for the email user.

use_tls: (Boolean) If true, TLS encryption will be used for the email.

messages: Contains settings for the contents of the email message.

recover: Contains settings for the contents of the email message sent when an account’s password is reset.

subject: (String) Subject line of the recovery email message.

headline: (String) Header of the recovery email message body.

message: (String) Message of the recovery email message.

activate: Contains settings for the contents of the email message sent when an account is created.

subject: (String) Subject line of the activation email message.

headline: (String) Header of the activation email message body.

message: (String) Message of the activation email message.

Endpoints

/easy0/api/settings/

GET - Retrieve the settings for the current user.

PUT - Modify the settings.


Common Responses

The following common responses may be encountered while using the Easy 0 API. The format of these responses may look different from the documented examples based on the tool used to make API calls.

Note

Many HTTP responses are a 200 OK due to the call to the API being successful. It is important to read the body of the response as it could contain an error.

Easy 0 Not Installed

When making an API call to a server that does not have Easy 0 installed, the following message will be seen.

curl -X POST \
         -H "Content-Type:application/json" \
         <niu-ha>/easy0/api/authenticate \
         -d '{"username":"<username>","password":"<password>"}'
         -v

< HTTP/1.1 404 Not Found
< Date: <datetime>
< Server: Apache/2.2.15 (CentOS)
< Content-Length: 412
< Content-Type: text/html; charset=iso-8859-1
<
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /easy0/api/authenticate was not found on this server.</p>
</body></html>

Note

This response is not controlled by the Easy 0 API and is entirely an HTTP response.

Incorrect Log In

When logging in to the API with incorrect or missing information, the following message will be seen.

curl -X POST \
         -d '{"username":"easy0_administrator"}' \
         localhost/easy0/api/authenticate
         -v

< HTTP/1.1 200 OK
< Date: <datetime>
< Server: Apache/2.2.15 (CentOS)
< Expires: <datetime>
< Vary: Cookie
< Cache-Control: max-age=0
< Last-Modified: <datetime>
< Content-Type: application/json
< Set-Cookie: easy0_sessionid=<cookie>; expires=<datetime>; httponly; Max-Age=1209600; Path=/easy0
< Transfer-Encoding: chunked
<
* Connection #0 to host localhost left intact
* Closing connection #0

{"meta": {
        "scope": "exception",
        "message": "The username and password provided were not correct.",
        "code": 401,
        "encoding": "ascii"
        },
"jsonapi": {
        "version": "1.2-11",
        "name": "Easy Zero",
        "short_name": "easy0",
        "author": "IMSWorkX, Inc."
        }
}

Unauthorized Action

When attempting to perform an action without the proper user permissions, such as a Service Provider creating another Service Provider, the following message will be seen.

{"meta": {
        "scope": "exception",
        "message": "You do not have permission to perform that operation.",
        "code": 403,
        "encoding": "ascii"},
"jsonapi": {"version": "1.2-11",
"name": "Easy Zero",
"short_name": "easy0",
"author": "IMSWorkX, Inc."}
}

Not Provisioned

When preforming a GET for data that has not been provisioned, the following message will be seen.

curl -X GET \
        -H "Authorization: Basic <secure-access-token>" \
        localhost/easy0/api/service_provider/service_test45 \
        -v

< HTTP/1.1 200 OK
< Date: <datetime>
< Server: Apache/2.2.15 (CentOS)
< Expires: <datetime>
< Vary: Cookie
< Cache-Control: max-age=0
< Last-Modified: <datetime>
< Content-Type: application/json
< Set-Cookie: easy0_sessionid=<cookie>; expires=<datetime>; httponly; Max-Age=1209600; Path=/easy0
< Transfer-Encoding: chunked
<
* Connection #0 to host localhost left intact
* Closing connection #0

{"meta": {
        "code": 200,
        "encoding": "ascii",
        "zoom": 0,
        "records_shown": 0,
        "records_total": 0,
        "scope": "success",
        "message": "",
        "archive": false,
        "authorization": "Basic <secure-access-token>"
        },
"data": [],
"jsonapi": {
        "version": "1.2-11",
        "name": "Easy Zero",
        "short_name": "easy0",
        "author": "IMSWorkX, Inc."
        }
}

Note

This is technically a successful call to the API, thus the 200 code return.

Object Does Not Exist

When creating an object that does not exist (for example, servi instead of service_provider), the following message will be seen.

curl -X GET \
         -H "Authorization: Basic <secure-access-token>" \
         localhost/easy0/api/servi
         -v

< HTTP/1.1 200 OK
< Date: <datetime>
< Server: Apache/2.2.15 (CentOS)
< Expires: <datetime>
< Vary: Cookie
< Cache-Control: max-age=0
< Last-Modified: <datetime>
< Content-Type: application/json
< Set-Cookie: easy0_sessionid=<cookie>; expires=<datetime>; httponly; Max-Age=1209600; Path=/easy0
< Transfer-Encoding: chunked
<
* Connection #0 to host localhost left intact
* Closing connection #0

{"meta": {
        "scope": "exception",
        "message": "No object 'servi' exists.",
        "code": "404"
        },
"jsonapi": {
        "version": "1.2-11",
        "name": "Easy Zero",
        "short_name": "easy0",
        "author": "IMSWorkX, Inc."
        }
}

Required Field Missing

If a required field is missing when creating an object, the following message will be seen.

curl -X POST \
         -H "Authorization: Basic <secure-access-token>" \
         localhost/easy0/api/service_provider \
         -d '{"last_name":"api_test"}' \
         -v

< HTTP/1.1 200 OK
< Date: <datetime>
< Server: Apache/2.2.15 (CentOS)
< Expires: <datetime>
< Vary: Cookie
< Cache-Control: max-age=0
< Last-Modified: <datetime>
< Content-Type: application/json
< Set-Cookie: easy0_sessionid=<cookie>; expires=<datetime>; httponly; Max-Age=1209600; Path=/easy0
< Transfer-Encoding: chunked
<
* Connection #0 to host localhost left intact
* Closing connection #0

{"meta": {
        "scope": "exception",
        "message": "ServiceProvider(): Field 'name' is required, but missing.",
        "code": 400,
        "encoding": "ascii"
        },
"jsonapi": {
        "version": "1.2-11",
        "name": "Easy Zero",
        "short_name": "easy0",
        "author": "IMSWorkX, Inc."
        }
}

No Method at Endpoint

When making a call with a method that is not valid at the specific endpoint, the following message will be seen.

 curl -X GE \
 -H "Authorization: Basic <secure-access-token>" \
 localhost/easy0/api/service_provider/service_test45 \
 -v

< HTTP/1.1 405 METHOD NOT ALLOWED
< Date: <datetime>
< Server: Apache/2.2.15 (CentOS)
< Expires: <datetime>
< Vary: Cookie
< Allow: GET, POST, PUT, DELETE
< Cache-Control: max-age=0
< Last-Modified: <datetime>
< Content-Length: 0
< Content-Type: text/html; charset=utf-8
< Set-Cookie: easy0_sessionid=<cookie>; expires=<datetime>; httponly; Max-Age=1209600; Path=/easy0
<
* Connection #0 to host localhost left intact
* Closing connection #0

Successful API Call

When making a successful API call, the following message will be seen.

curl -X GET \
        -H "Authorization: Basic <secure-access-token>" \
        localhost/easy0/api/service_provider/ \
        -v

< HTTP/1.1 200 OK
< Date: <datetime>
< Server: Apache/2.2.15 (CentOS)
< Expires: <datetime>
< Vary: Cookie
< Cache-Control: max-age=0
< Last-Modified: <datetime>
< Content-Type: application/json
< Set-Cookie: easy0_sessionid=<cookie>; expires=<datetime>; httponly; Max-Age=1209600; Path=/easy0
< Transfer-Encoding: chunked
<
* Connection #0 to host localhost left intact
* Closing connection #0

{"meta": {
        "code": 200,
        "encoding": "ascii",
        "zoom": 0,
        "records_page_offset": 0,
        "records_shown": 1,
        "records_total": 1,
        "scope": "success",
        "message": "",
        "archive": false,
        "authorization": "Basic <secure-access-token>",
        "records_page_size": 10
},
"data": [{
        <DATA FROM OBJECT>
}],
"jsonapi": {
        "version": "1.2-11",
        "name": "Easy Zero",
        "short_name": "easy0",
        "author": "IMSWorkX, Inc."
        }
}

The above responses can be seen as responses from a stable Easy 0 API. If you encounter other undocumented API errors, please contact support@imsworkx.com with the API call and output.


Audit Logging

Audit logs are generated every day by default and are stored as a CSV file. By default, these files are located in /var/opt/xpressworkx/app-manager/easy0/logs/audit-logs and are named audit-<year>.<month>.<day>.log.