wiki:S3/S3REST/URLFormat

Version 4 (modified by Dominic König, 11 years ago) ( diff )

--

S3XRC | S3 RESTful API | URL Format

S3 RESTful API - URL Format

Basic URL Syntax

  • Parts in { } are optional, [ ] indicate alternatives

The basic URL format is: /prefix/name{ /<arguments> }{ ?<query> }

  • prefix is the resource prefix (="module" name)
  • name is the resource name (without prefix)
  • arguments is a list of: { /id }{ / [ method | component { /component_id } { /method } ] }
    • id is a record ID in the main resource
    • component is a component resource name (without prefix)
    • component_id is a record ID in the component resource
    • method is a URL method (only in GET/POST requests, e.g. "create", "update" or "delete")
  • query syntax see below

Basic Query Format

The basic query format is: resource.field{operator}=value

  • resource is the name of the resource or component (without prefix) or the name of the context
  • field is the name of the field to be tested
  • operator is the operator
  • value is the value or a comma-separated list of values to test against (a comma will be treated as OR)

Supported operators:

OperatorMethodComments
__eqequal, =can be omitted
__nenot equal, =||
__ltless than, <numeric and date types only
__leless than or equal, <numeric and date types only
__gtgreater than, >numeric and date types only
__gegreater than or equal, >numeric and date types only
__likelike, LIKE(%value%)string/text types only
__unlikenot like, NOT LIKE(%value%)string/text types only
__incontainment, contains(value)list types only
__exnegative containment, not contains(value)list types only

Field Queries

  • Testing a field in the main resource
    /pr/person?person.first_name__like=Miriam
    

Component Field Queries

  • Testing a field in a component resource
    /pr/person?address.city__like=Oslo
    

Context Queries

  • Testing a field in a referenced resource
  • Context must be specified like context.name={component.}field
    • name is a name for the context (as reference for subsequent queries)
    • component is the name of the component resource (without prefix)
    • field is the field name of the foreign key field
/pr/person?context.location=address.location_id&location.lat__gt=0

URL Examples

Interactive (HTML) Format

Non-interactive Formats

URL Method

Record ID

Record UID

URL Queries


DeveloperGuidelines

Note: See TracWiki for help on using the wiki.