Skip to content

Developers' Guide

Neil O'Keeffe edited this page Jun 23, 2022 · 5 revisions

Developers' Guide

Introduction

This page outlines how the API may be used in your code.

Web Methods

The API has the following Web request classes:

  • JSONRPC
  • RESTFUL
  • STATIC

Each of these classes has its own request and response classes. The request and response classes are abstracted to an IRequest and IResponse interface. However, you are free to choose whether to use the abstract or concrete classes.

Exposing your code to the web

Any public method in your code will be available to the API and therefore to any external user. Therefore it is important that you do not inadvertently expose sensitive methods to users. Up until version 5.0.0 this was done by ensuring that only the exposed classes and methods can be declared as public. Everything else had to be declared as, at most, external. From 5.0.0, public methods are no longer visible to the API by default. If you want your class to be visible to the API then you MUST now decorate any exposed classes with the AllowAPICall attribute. For example, the first piece of code shown below is not visible to the API. The second class is visible:

    [AllowAPICall]
    public class CanBeCalled
    {
        public static dynamic Read()
        {
            return "something";
        }
    }

    public class CanNotBeCalled
    {
        public static dynamic Read()
        {
            return "something";
        }
    }

IRequest Interface

Clone this wiki locally