Previous Topic

Next Topic

Web Service Actions and Functions

The following Web Service end points can be used to retrieve lists of Web Service Functions or Actions.

See Web Service Functions in MaxBasic for sample code to access Web Services.

The following will return a list of available Web Service functions in a JSON object:

Response = MakeCall("$metadata/functions?$format=json")

The following will return a list of available Web Service actions in a JSON object:

Response = MakeCall("$metadata/actions?$format=json")

You can also retrieve a list of End Points in a HTML document. In your browser enter your company URL followed by /developerdoc , /$metadata or /autodoc. For example:

http(s)://{domain}:{port}/{serviceroot}/odata4/v1/company({company})/developerdoc

http(s)://{domain}:{port}/{serviceroot}/odata4/v1/company({company})/$metadata

http(s)://{domain}:{port}/{serviceroot}/odata4/v1/company({company})/autodoc

For a formatted list of endpoints use:

http(s)://{domain}:{port}/{serviceroot}/odata4/v1/company({company})/$metadata?$format=json

http(s)://{domain}:{port}/{serviceroot}/odata4/v1/company({company})/$metadata/Types?$format=json

http(s)://{domain}:{port}/{serviceroot}/odata4/v1/company({company})/$metadata/Actions?$format=json

http(s)://{domain}:{port}/{serviceroot}/odata4/v1/company({company})/$metadata/Functions?$format=json

http(s)://{domain}:{port}/{serviceroot}/odata4/v1/company({company})/$metadata/Properties?$format=json

The following will return a list of endpoints:

http(s)://{domain}:{port}/{serviceroot}/odata4/v1/company({company})/$metadata/Types?$format=json&$Select=Name,AccredoType

To get system details, enter:

http(s)://{domain}:{port}/{serviceroot}/odata4/v1/company({company})/developerdoc

Actions

Actions are issued by POST calls, and usually have a persistent affect, meaning that they write to a table or change data. Parameters are contained in the body of the request as JSON. For example:

{ "Param1":"Value", "Param2":"Value" }

Functions

Functions are issued by GET calls, and usually do not have a persistent affect. Parameters for actions are included in the URL. For example:

ActionName(Param1='Value', Param2='Value')

Note: Some endpoints support both functions and actions. See the web service metadata for details of which endpoints this applies to. This is to allow functions with many parameters to be used as actions if URL character limits apply.

Using Web Service Actions

Some Web Service actions in the metadata are referred to without a slash, so they can be displayed in different software utilities.

For example, the Action INInvoicePost is the same as the INInvoice/Post action. You can identify actions that have the slash removed by:

Example use of the INInvoicePost action, where the $ID represents the Invoice ID:

Url: .....INInvoice($ID)/Post

Body:

{ "BankThrough": false, "CashSale" : true, "BankAccountCode" : "NZCHEQUE" }

In This Section

System Web Service Actions and Functions

Company Web Service Actions and Functions

AR Web Service Actions and Functions

IC Web Service Actions and Functions

IN Web Service Actions and Functions

OE Web Service Actions and Functions

AP Web Service Actions and Functions

PO Web Service Actions and Functions

CB Web Service Actions and Functions

FA Web Service Actions and Functions

GL Web Service Actions and Functions

JC Web Service Actions and Functions

SP Web Service Actions and Functions

PP Web Service Actions and Functions

GST Web Service Actions and Functions

{Object}/Print and {Object}/PrintSheet - Web Service Function

See Also

Web Service

Book Contents

Book Index