RESTQL

B2Bi supports RESTQL (REST Query Language), which uses a flexible query syntax. For more information, see http://apigee.com/docs/app-services/content/querying-your-data and http://apigee.com/docs/app-services/content/working-queries.

B2Bi supports the query statements described in the following table. Statements can be combined in various ways. Non-listed statements are not supported.

Query parameter

Generic samples

IN

Age IN (5, 10, 15) City IN ('Boston', 'New York', 'Paris')

BETWEEN Age BETWEEN 20 AND 30
LIKE Name LIKE '%Smith%'

LT, LE, GT, GE, EQ, NE (<, <=, >, >=, =, <>)

Name = 'Jones'
TRUE, FALSE Enabled = False
TRIM TRIM(Address) = '123 Easy Street'
UPPER, LOWER UPPER(Address) = '123 EASY STREET'
NOT Name NOT LIKE '%Smith%' City NOT IN ('Boston', 'New York', 'Paris')
AND, OR Age IN (5, 10, 15) AND City = 'Boston'
IS (NOT) NULL CountryCode IS NULL
ASC | DESC Age, Gender DESC Age DESC, Gender ASC

RESTQL mechanisms in the trading engine

RESTQL is implemented in the RESTful HTTP interfaces that interact with the various beans defined in the system. A "bean" represents a configuration object that can be set and retrieved.

The beans described in the following tables are accessible and can be used within RESTQL.

CommunityBean: https://<host>:<port>/restapi/v1/communities

Name(s)

Type

Prefix

partyName

String

 

countryCode String  
_id String  
aliases RoutingIdBean routingID
contacts ContactBean contact

TradingPartnerBean: https://<host>:<port>/restapi/v1/tradingPartners

Name(s)

Type

Prefix

partyName

String

 

countryCode String  
_id String  
aliases RoutingIdBean routingID
contacts ContactBean contact

ContactBean

Name(s)

Type

Prefix

email

String

 

name String  
title String  
phone String  

RoutingIdBean

Name(s)

Type

Prefix

id

String

 

type String  

For more information about the various beans, see the Swagger API Javadoc.

To open Swagger and consult the Javadoc, open a browser and enter the URL https://<host>:<port>/apidocs/ui.

Sample queries

The following are sample queries to demonstrate how RESTQL can be used with B2Bi:

  • To filter for a community or trading partner where partyName starts with Acme: GET http://<host>:<port>/rest/v1/communities?filter=partyName like '%Acme%'https://<host>:<port>/api/v1/communities?filter=partyName%20like%20'%25Acme%25'.
  • To search for a trading partner based on a contact email address (name@domain.com):
    1. Start at the CommunityBean, then look at the contact field (type = ContactBean).
    2. Use the prefix column for this particular contact field.
    3. Based on that, construct your filter. For example, GET https://<host>:<port>/restapi/v1/communities?filter=contact.email = 'bsmith@acme.com'

Other examples:

  • filter=partyName Like '%BLUELINX%'
  • filter=contact.name='Bob Smith'
  • filter=routingId.id like 'ZZ%'
  • filter=routingId.id like 'ZZ%' Or routingId.id Like '01%'
  • filter=routingId.id IN('ZZ4022910733', '011339472', '126306941500')
  • filter=(partyName Like '%BLUELINX%' OR contact.name = 'Bob Smith').

Related topics

Related Links