User Tools

Site Tools


api:search

API : Search

Introduction

The search function is the primary function for finding anything. It will search through customer, employee, SIP accounts, MVNO accounts, numbers, portings, DSL and Fiber accounts. Not all data is exposed to the search, but all primary data in any of the search sections is available.

Request

URL https://api.telecomx.dk/search
Method GET (preferred) or POST
Query query What to search for, names, addresses, numbers, codes etc.
offset [optional] If paging through a larger set of results, this is the index of the first item to return, default 0.
limit [optional] The number of items to return, default 100, max. 1000
includeDeleted [optional] True to also include deleted customers in the search
includeSubResellers [optional] True to also include customers of your sub resellers in the search (this requires that the user is a reseller with access level RESELLER.
Body JSON object (only if method is POST) - see query section above for arguments

Query example

https://api.telecomx.dk/search?query=customername&offset=0&limit=100&includeDeleted=false&includeSubResellers=true

Response

JSON object
offset Index of the first returned item in the total search result, 0-based
limit Number of items to return (actual count may be less if offset + limit > total)
total Total number of items in the search result. Useful for paging through a large result set
results Array of result objects - see description below. The results are ordered according to how they scored in the search.

The result object

Each result object has a set of common fields:

Key Type Description Example
score Number A number that specifies how high a score the result got during the search. The higher the value, the more likely the item is to be what the user is searching for. Used to order results so that the most relevant items gets shown first. 51
type String The type of this item. Can be 'customer', 'employee', 'sip', 'mvno', 'dsl', 'fiber', 'porting' 'sip'
id Id Id of the matched item 1234567890ABCDEF12345678
url String Url for accessing the item in the api /sip/1234567890ABCDEF12345678
customer Id Id of the customer that the item belongs to ABCDEF1234567890ABCDEF12
customerName String Name of the customer that the item belongs to Northwind Industries
customerFeatures Array List of features in the TelecomX platform that the customer has access to. Can only be set by ADMIN or RESELLER users. A reseller can only assign features that the reseller has to the resellers customers.
The available features are:
CUSTOMER - Basics, addresses, financial, usage limits, employees
SIP - SIP trunks
MVNO - Mobile phones
PBX - Hosted PBX, SIP phones, music on hold, Webhooks (auto-enables SIP, MVNO, CUSTOMER)
TCE - Telecom Call Enhancer
DNS - Domain management
INTERNET - Fiber & xDSL
TV - TV
['CUSTOMER','SIP','MVNO']
label String A label that describes the item. For a customer or employee it's the name, for a sip or mvno account it's the number, for a dsl or fiber account it's the circuit-id and for a porting it's the number. Hans Christian Andersen
values Object A sub object of additional information about the matched item in a key/value format. See the possibilities below.

Result value examples

Type Key Value example
customer phoneNumber 12345678
emailAddress info@company.com
vatNumber DK12345678
address Frugtmarkedet 17, 2500 Valby
employee title Manager
department Sales
emailAddress hans.grueber@livesoft.com
fixedNumber 22222222
mobileNumber 33333333
sip active true
numbers 70101010, 44450000-99
status ON
mvno active true
sim 45891234567890123456
status ON
internet state ACTIVE
address Frugtmarkedet 17, 2500 Valby
product Fiber 100Mbit
ipAddress 77.66.100.123
status ON
porting numberType SIP
statusStage IN_ORDERED
statusDate 2014-01-05T12:34:56.000Z
requestedDate 2014-01-01T12:34:56.000Z
portingDate 2014-01-10T12:34:56.000Z
tce ipAddress 192.168.10.23
publicIp 77.66.100.124
status ON

Example

{
  offset: 0,
  limit: 100,
  total: 354,
  results: [
    {
      score: 51,
      type: 'customer',
      id: '1234567890ABCDEF123456',
      url: '/customer/1234567890ABCDEF123456',
      customer: '1234567890ABCDEF123456',
      customerName: 'Northwind Industries',
      customerFeatures: ['CUSTOMER','SIP','MVNO'],
      label: 'Northwind Industries',
      values: {
        phoneNumber: '12345678',
        emailAddress: 'info@northwind.com',
        vatNumber: '1234567890',
        address: 'Frugtmarkedet 17, 2500 Valby'
      }
    },
    {
      score: 38,
      type: 'sip',
      id: '11223344556677889900AABB',
      url: '/sip/11223344556677889900AABB',
      customer: '1234567890ABCDEF123456',
      customerName: 'Northwind Industries',
      customerFeatures: ['CUSTOMER','SIP','MVNO'],
      label: 'Primary trunk Copenhagen',
      values: {
        active: true,
        numbers: '70101010, 44450000-99',
        status: 'ON'
      }
    }
  ]
}

Errors

This function will only return generic errors if any - see auth.

api/search.txt · Last modified: 2016/05/29 11:19 by Per Møller

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki