Class: CentralIndex

Inherits:
Object
  • Object
show all
Defined in:
lib/CentralIndex.rb

Instance Method Summary collapse

Constructor Details

#initialize(apiKey, debugMode) ⇒ CentralIndex

constructor



11
12
13
14
# File 'lib/CentralIndex.rb', line 11

def initialize(apiKey, debugMode)
  @apiKey    = apiKey
  @debugMode = debugMode
end

Instance Method Details

#deleteCategorySynonym(category_id, synonym, language) ⇒ Object

With a known category id, a synonyms object can be removed.

@param category_id
@param synonym
@param language
@return - the data from the api


271
272
273
274
275
276
277
# File 'lib/CentralIndex.rb', line 271

def deleteCategorySynonym( category_id, synonym, language)
  params = Hash.new
  params['category_id'] = category_id
  params['synonym'] = synonym
  params['language'] = language
  return doCurl("delete","/category/synonym",params)
end

#deleteEntityAdvertiser(entity_id, gen_id) ⇒ Object

Allows an advertiser object to be reduced in confidence

@param entity_id
@param gen_id
@return - the data from the api


429
430
431
432
433
434
# File 'lib/CentralIndex.rb', line 429

def deleteEntityAdvertiser( entity_id, gen_id)
  params = Hash.new
  params['entity_id'] = entity_id
  params['gen_id'] = gen_id
  return doCurl("delete","/entity/advertiser",params)
end

Allows an affiliate link object to be reduced in confidence

@param entity_id
@param gen_id
@return - the data from the api


630
631
632
633
634
635
# File 'lib/CentralIndex.rb', line 630

def deleteEntityAffiliate_link( entity_id, gen_id)
  params = Hash.new
  params['entity_id'] = entity_id
  params['gen_id'] = gen_id
  return doCurl("delete","/entity/affiliate_link",params)
end

#deleteEntityCategory(entity_id, gen_id) ⇒ Object

Allows a category object to be reduced in confidence

@param entity_id
@param gen_id
@return - the data from the api


748
749
750
751
752
753
# File 'lib/CentralIndex.rb', line 748

def deleteEntityCategory( entity_id, gen_id)
  params = Hash.new
  params['entity_id'] = entity_id
  params['gen_id'] = gen_id
  return doCurl("delete","/entity/category",params)
end

#deleteEntityDescription(entity_id, gen_id) ⇒ Object

Allows a description object to be reduced in confidence

@param entity_id
@param gen_id
@return - the data from the api


814
815
816
817
818
819
# File 'lib/CentralIndex.rb', line 814

def deleteEntityDescription( entity_id, gen_id)
  params = Hash.new
  params['entity_id'] = entity_id
  params['gen_id'] = gen_id
  return doCurl("delete","/entity/description",params)
end

#deleteEntityDocument(entity_id, gen_id) ⇒ Object

Allows a phone object to be reduced in confidence

@param entity_id
@param gen_id
@return - the data from the api


863
864
865
866
867
868
# File 'lib/CentralIndex.rb', line 863

def deleteEntityDocument( entity_id, gen_id)
  params = Hash.new
  params['entity_id'] = entity_id
  params['gen_id'] = gen_id
  return doCurl("delete","/entity/document",params)
end

#deleteEntityEmail(entity_id, gen_id) ⇒ Object

Allows a email object to be reduced in confidence

@param entity_id
@param gen_id
@return - the data from the api


878
879
880
881
882
883
# File 'lib/CentralIndex.rb', line 878

def deleteEntityEmail( entity_id, gen_id)
  params = Hash.new
  params['entity_id'] = entity_id
  params['gen_id'] = gen_id
  return doCurl("delete","/entity/email",params)
end

#deleteEntityEmployee(entity_id, gen_id) ⇒ Object

Allows an employee object to be reduced in confidence

@param entity_id
@param gen_id
@return - the data from the api


937
938
939
940
941
942
# File 'lib/CentralIndex.rb', line 937

def deleteEntityEmployee( entity_id, gen_id)
  params = Hash.new
  params['entity_id'] = entity_id
  params['gen_id'] = gen_id
  return doCurl("delete","/entity/employee",params)
end

#deleteEntityFax(entity_id, gen_id) ⇒ Object

Allows a fax object to be reduced in confidence

@param entity_id
@param gen_id
@return - the data from the api


952
953
954
955
956
957
# File 'lib/CentralIndex.rb', line 952

def deleteEntityFax( entity_id, gen_id)
  params = Hash.new
  params['entity_id'] = entity_id
  params['gen_id'] = gen_id
  return doCurl("delete","/entity/fax",params)
end

#deleteEntityGroup(entity_id, gen_id) ⇒ Object

Allows a group object to be removed from an entities group members

@param entity_id
@param gen_id
@return - the data from the api


1018
1019
1020
1021
1022
1023
# File 'lib/CentralIndex.rb', line 1018

def deleteEntityGroup( entity_id, gen_id)
  params = Hash.new
  params['entity_id'] = entity_id
  params['gen_id'] = gen_id
  return doCurl("delete","/entity/group",params)
end

#deleteEntityImage(entity_id, gen_id) ⇒ Object

Allows a image object to be reduced in confidence

@param entity_id
@param gen_id
@return - the data from the api


1050
1051
1052
1053
1054
1055
# File 'lib/CentralIndex.rb', line 1050

def deleteEntityImage( entity_id, gen_id)
  params = Hash.new
  params['entity_id'] = entity_id
  params['gen_id'] = gen_id
  return doCurl("delete","/entity/image",params)
end

#deleteEntityInvoice_address(entity_id) ⇒ Object

With a known entity id and a known invoice_address ID, we can delete a specific invoice_address object from an enitity.

@param entity_id
@return - the data from the api


1064
1065
1066
1067
1068
# File 'lib/CentralIndex.rb', line 1064

def deleteEntityInvoice_address( entity_id)
  params = Hash.new
  params['entity_id'] = entity_id
  return doCurl("delete","/entity/invoice_address",params)
end

#deleteEntityList(gen_id, entity_id) ⇒ Object

Allows a list description object to be reduced in confidence

@param gen_id
@param entity_id
@return - the data from the api


1111
1112
1113
1114
1115
1116
# File 'lib/CentralIndex.rb', line 1111

def deleteEntityList( gen_id, entity_id)
  params = Hash.new
  params['gen_id'] = gen_id
  params['entity_id'] = entity_id
  return doCurl("delete","/entity/list",params)
end

#deleteEntityLogo(entity_id, gen_id) ⇒ Object

Allows a phone object to be reduced in confidence

@param entity_id
@param gen_id
@return - the data from the api


1160
1161
1162
1163
1164
1165
# File 'lib/CentralIndex.rb', line 1160

def ( entity_id, gen_id)
  params = Hash.new
  params['entity_id'] = entity_id
  params['gen_id'] = gen_id
  return doCurl("delete","/entity/logo",params)
end

#deleteEntityPhone(entity_id, gen_id) ⇒ Object

Allows a phone object to be reduced in confidence

@param entity_id
@param gen_id
@return - the data from the api


1272
1273
1274
1275
1276
1277
# File 'lib/CentralIndex.rb', line 1272

def deleteEntityPhone( entity_id, gen_id)
  params = Hash.new
  params['entity_id'] = entity_id
  params['gen_id'] = gen_id
  return doCurl("delete","/entity/phone",params)
end

#deleteEntitySocialmedia(entity_id, gen_id) ⇒ Object

Allows a social media object to be reduced in confidence

@param entity_id
@param gen_id
@return - the data from the api


1605
1606
1607
1608
1609
1610
# File 'lib/CentralIndex.rb', line 1605

def deleteEntitySocialmedia( entity_id, gen_id)
  params = Hash.new
  params['entity_id'] = entity_id
  params['gen_id'] = gen_id
  return doCurl("delete","/entity/socialmedia",params)
end

#deleteEntitySpecial_offer(entity_id, gen_id) ⇒ Object

Allows a special offer object to be reduced in confidence

@param entity_id
@param gen_id
@return - the data from the api


1620
1621
1622
1623
1624
1625
# File 'lib/CentralIndex.rb', line 1620

def deleteEntitySpecial_offer( entity_id, gen_id)
  params = Hash.new
  params['entity_id'] = entity_id
  params['gen_id'] = gen_id
  return doCurl("delete","/entity/special_offer",params)
end

#deleteEntityTag(entity_id, gen_id) ⇒ Object

Allows a tag object to be reduced in confidence

@param entity_id
@param gen_id
@return - the data from the api


1677
1678
1679
1680
1681
1682
# File 'lib/CentralIndex.rb', line 1677

def deleteEntityTag( entity_id, gen_id)
  params = Hash.new
  params['entity_id'] = entity_id
  params['gen_id'] = gen_id
  return doCurl("delete","/entity/tag",params)
end

#deleteEntityTestimonial(entity_id, gen_id) ⇒ Object

Allows a testimonial object to be reduced in confidence

@param entity_id
@param gen_id
@return - the data from the api


1730
1731
1732
1733
1734
1735
# File 'lib/CentralIndex.rb', line 1730

def deleteEntityTestimonial( entity_id, gen_id)
  params = Hash.new
  params['entity_id'] = entity_id
  params['gen_id'] = gen_id
  return doCurl("delete","/entity/testimonial",params)
end

#deleteEntityVideo(entity_id, gen_id) ⇒ Object

Allows a video object to be reduced in confidence

@param entity_id
@param gen_id
@return - the data from the api


1762
1763
1764
1765
1766
1767
# File 'lib/CentralIndex.rb', line 1762

def deleteEntityVideo( entity_id, gen_id)
  params = Hash.new
  params['entity_id'] = entity_id
  params['gen_id'] = gen_id
  return doCurl("delete","/entity/video",params)
end

#deleteEntityWebsite(entity_id, gen_id) ⇒ Object

Allows a website object to be reduced in confidence

@param entity_id
@param gen_id
@return - the data from the api


1811
1812
1813
1814
1815
1816
# File 'lib/CentralIndex.rb', line 1811

def deleteEntityWebsite( entity_id, gen_id)
  params = Hash.new
  params['entity_id'] = entity_id
  params['gen_id'] = gen_id
  return doCurl("delete","/entity/website",params)
end

#deleteFlatpack(flatpack_id) ⇒ Object

Remove a flatpack using a supplied flatpack_id

@param flatpack_id - the id of the flatpack to delete
@return - the data from the api


1842
1843
1844
1845
1846
# File 'lib/CentralIndex.rb', line 1842

def deleteFlatpack( flatpack_id)
  params = Hash.new
  params['flatpack_id'] = flatpack_id
  return doCurl("delete","/flatpack",params)
end

Remove a canned link to an existing flatpack site.

@param flatpack_id - the id of the flatpack to delete
@param gen_id - the id of the canned link to remove
@return - the data from the api


2017
2018
2019
2020
2021
2022
# File 'lib/CentralIndex.rb', line 2017

def deleteFlatpackLink( flatpack_id, gen_id)
  params = Hash.new
  params['flatpack_id'] = flatpack_id
  params['gen_id'] = gen_id
  return doCurl("delete","/flatpack/link",params)
end

#deleteGroup(group_id) ⇒ Object

Delete a group with a specified group_id

@param group_id
@return - the data from the api


2097
2098
2099
2100
2101
# File 'lib/CentralIndex.rb', line 2097

def deleteGroup( group_id)
  params = Hash.new
  params['group_id'] = group_id
  return doCurl("delete","/group",params)
end

#deleteLocationSynonym(location_id, synonym, language) ⇒ Object

Remove a new synonym from a known location

@param location_id
@param synonym
@param language
@return - the data from the api


2219
2220
2221
2222
2223
2224
2225
# File 'lib/CentralIndex.rb', line 2219

def deleteLocationSynonym( location_id, synonym, language)
  params = Hash.new
  params['location_id'] = location_id
  params['synonym'] = synonym
  params['language'] = language
  return doCurl("delete","/location/synonym",params)
end

#deletePrivate_object(private_object_id) ⇒ Object

Allows a private object to be removed

@param private_object_id - The id of the private object to remove
@return - the data from the api


2472
2473
2474
2475
2476
# File 'lib/CentralIndex.rb', line 2472

def deletePrivate_object( private_object_id)
  params = Hash.new
  params['private_object_id'] = private_object_id
  return doCurl("delete","/private_object",params)
end

#deletePublisher(publisher_id) ⇒ Object

Delete a publisher with a specified publisher_id

@param publisher_id
@return - the data from the api


2511
2512
2513
2514
2515
# File 'lib/CentralIndex.rb', line 2511

def deletePublisher( publisher_id)
  params = Hash.new
  params['publisher_id'] = publisher_id
  return doCurl("delete","/publisher",params)
end

#deleteQueue(queue_id) ⇒ Object

With a known queue id, a queue item can be removed.

@param queue_id
@return - the data from the api


2586
2587
2588
2589
2590
# File 'lib/CentralIndex.rb', line 2586

def deleteQueue( queue_id)
  params = Hash.new
  params['queue_id'] = queue_id
  return doCurl("delete","/queue",params)
end

#deleteTraction(traction_id) ⇒ Object

Deleting a traction

@param traction_id
@return - the data from the api


3168
3169
3170
3171
3172
# File 'lib/CentralIndex.rb', line 3168

def deleteTraction( traction_id)
  params = Hash.new
  params['traction_id'] = traction_id
  return doCurl("delete","/traction",params)
end

#doCurl(method, path, params) ⇒ Object

make ‘curl’ request to the api server



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/CentralIndex.rb', line 17

def doCurl(method,path,params)
  # api constants
  domain = 'api.centralindex.com'
  endpoint = '/v1'
  path = endpoint+path
  params['api_key'] = @apiKey
  retval = ''

  # create an HTTP connection
  http = Net::HTTP.new(domain) 
  if @debugMode
    http.set_debug_output $stderr
  end

  if(method == 'get') 
    # crazy dance to get urlencode parameters from Ruby
    request = Net::HTTP::Get.new(path) 
    request.set_form_data( params, sep = '&' )
    request = Net::HTTP::Get.new( path+ '?' + request.body )
    retval = http.request(request)
  end
  if(method == 'post')
    request = Net::HTTP::Post.new(path)
    request.set_form_data(params)
    retval = http.request(request)
  end
  if(method == 'put')
    request = Net::HTTP::Put.new(path)
    request.set_form_data(params)
    retval = http.request(request)
  end
  if(method == 'delete')
    request = Net::HTTP::Put.new(path)
    request.set_form_data(params)
    retval = http.request(request)
  end
  parsed = JSON.parse(retval.body)
  if(parsed)
    return parsed
  else
    return retval.body
  end
end

#getAdvertiserUpdated(from_date, country) ⇒ Object

Get all advertisers that have been updated from a give date for a given reseller

@param from_date
@param country
@return - the data from the api


69
70
71
72
73
74
# File 'lib/CentralIndex.rb', line 69

def getAdvertiserUpdated( from_date, country)
  params = Hash.new
  params['from_date'] = from_date
  params['country'] = country
  return doCurl("get","/advertiser/updated",params)
end

#getAutocompleteCategory(str, language) ⇒ Object

The search matches a category name on a given string and language.

@param str - A string to search against, E.g. Plumbers e.g. but
@param language - An ISO compatible language code, E.g. en e.g. en
@return - the data from the api


84
85
86
87
88
89
# File 'lib/CentralIndex.rb', line 84

def getAutocompleteCategory( str, language)
  params = Hash.new
  params['str'] = str
  params['language'] = language
  return doCurl("get","/autocomplete/category",params)
end

#getAutocompleteKeyword(str, language) ⇒ Object

The search matches a category name or synonym on a given string and language.

@param str - A string to search against, E.g. Plumbers e.g. but
@param language - An ISO compatible language code, E.g. en e.g. en
@return - the data from the api


99
100
101
102
103
104
# File 'lib/CentralIndex.rb', line 99

def getAutocompleteKeyword( str, language)
  params = Hash.new
  params['str'] = str
  params['language'] = language
  return doCurl("get","/autocomplete/keyword",params)
end

#getAutocompleteLocation(str, country) ⇒ Object

The search matches a location name or synonym on a given string and language.

@param str - A string to search against, E.g. Dub e.g. dub
@param country - Which country to return results for. An ISO compatible country code, E.g. ie e.g. ie
@return - the data from the api


114
115
116
117
118
119
# File 'lib/CentralIndex.rb', line 114

def getAutocompleteLocation( str, country)
  params = Hash.new
  params['str'] = str
  params['country'] = country
  return doCurl("get","/autocomplete/location",params)
end

#getAutocompletePostcode(str, country) ⇒ Object

The search matches a postcode to the supplied string

@param str - A string to search against, E.g. W1 e.g. W1
@param country - Which country to return results for. An ISO compatible country code, E.g. gb e.g. gb
@return - the data from the api


129
130
131
132
133
134
# File 'lib/CentralIndex.rb', line 129

def getAutocompletePostcode( str, country)
  params = Hash.new
  params['str'] = str
  params['country'] = country
  return doCurl("get","/autocomplete/postcode",params)
end

#getCategory(category_id) ⇒ Object

Returns the supplied wolf category object by fetching the supplied category_id from our categories object.

@param category_id
@return - the data from the api


194
195
196
197
198
# File 'lib/CentralIndex.rb', line 194

def getCategory( category_id)
  params = Hash.new
  params['category_id'] = category_id
  return doCurl("get","/category",params)
end

#getCategoryAllObject

Returns all Central Index categories and associated data

@return - the data from the api


223
224
225
226
# File 'lib/CentralIndex.rb', line 223

def getCategoryAll()
  params = Hash.new
  return doCurl("get","/category/all",params)
end

#getCountry(country_id) ⇒ Object

Fetching a country

@param country_id
@return - the data from the api


358
359
360
361
362
# File 'lib/CentralIndex.rb', line 358

def getCountry( country_id)
  params = Hash.new
  params['country_id'] = country_id
  return doCurl("get","/country",params)
end

#getEntity(entity_id) ⇒ Object

Allows a whole entity to be pulled from the datastore by its unique id

@param entity_id - The unique entity ID e.g. 379236608286720
@return - the data from the api


415
416
417
418
419
# File 'lib/CentralIndex.rb', line 415

def getEntity( entity_id)
  params = Hash.new
  params['entity_id'] = entity_id
  return doCurl("get","/entity",params)
end

#getEntityAdvertisers(tag, where, limit, country, language) ⇒ Object

Search for matching entities that are advertisers and return a random selection upto the limit requested

@param tag - The word or words the advertiser is to appear for in searches
@param where - The location to get results for. E.g. Dublin
@param limit - The number of advertisers that are to be returned
@param country - Which country to return results for. An ISO compatible country code, E.g. ie e.g. ie
@param language - An ISO compatible language code, E.g. en
@return - the data from the api


591
592
593
594
595
596
597
598
599
# File 'lib/CentralIndex.rb', line 591

def getEntityAdvertisers( tag, where, limit, country, language)
  params = Hash.new
  params['tag'] = tag
  params['where'] = where
  params['limit'] = limit
  params['country'] = country
  params['language'] = language
  return doCurl("get","/entity/advertisers",params)
end

#getEntityBulkCsvStatus(upload_id) ⇒ Object

Shows the current status of a bulk upload

@param upload_id
@return - the data from the api


682
683
684
685
686
# File 'lib/CentralIndex.rb', line 682

def getEntityBulkCsvStatus( upload_id)
  params = Hash.new
  params['upload_id'] = upload_id
  return doCurl("get","/entity/bulk/csv/status",params)
end

#getEntityBulkJsonStatus(upload_id) ⇒ Object

Shows the current status of a bulk JSON upload

@param upload_id
@return - the data from the api


708
709
710
711
712
# File 'lib/CentralIndex.rb', line 708

def getEntityBulkJsonStatus( upload_id)
  params = Hash.new
  params['upload_id'] = upload_id
  return doCurl("get","/entity/bulk/json/status",params)
end

#getEntityBy_supplier_id(supplier_id) ⇒ Object

Fetches the documents that match the given masheryid and supplier_id

@param supplier_id - The Supplier ID
@return - the data from the api


721
722
723
724
725
# File 'lib/CentralIndex.rb', line 721

def getEntityBy_supplier_id( supplier_id)
  params = Hash.new
  params['supplier_id'] = supplier_id
  return doCurl("get","/entity/by_supplier_id",params)
end

#getEntityBy_user_id(user_id) ⇒ Object

Get all entiies claimed by a specific user

@param user_id - The unique user ID of the user with claimed entities e.g. 379236608286720
@return - the data from the api


734
735
736
737
738
# File 'lib/CentralIndex.rb', line 734

def getEntityBy_user_id( user_id)
  params = Hash.new
  params['user_id'] = user_id
  return doCurl("get","/entity/by_user_id",params)
end

#getEntityChangelog(entity_id) ⇒ Object

Fetches the changelog documents that match the given entity_id

@param entity_id
@return - the data from the api


779
780
781
782
783
# File 'lib/CentralIndex.rb', line 779

def getEntityChangelog( entity_id)
  params = Hash.new
  params['entity_id'] = entity_id
  return doCurl("get","/entity/changelog",params)
end

#getEntityRevisions(entity_id) ⇒ Object

Allows a list of available revisions to be returned by its entity id

@param entity_id
@return - the data from the api


1321
1322
1323
1324
1325
# File 'lib/CentralIndex.rb', line 1321

def getEntityRevisions( entity_id)
  params = Hash.new
  params['entity_id'] = entity_id
  return doCurl("get","/entity/revisions",params)
end

#getEntityRevisionsByRevisionID(entity_id, revision_id) ⇒ Object

Allows a specific revision of an entity to be returned by entity id and a revision number

@param entity_id
@param revision_id
@return - the data from the api


1335
1336
1337
1338
1339
1340
# File 'lib/CentralIndex.rb', line 1335

def getEntityRevisionsByRevisionID( entity_id, revision_id)
  params = Hash.new
  params['entity_id'] = entity_id
  params['revision_id'] = revision_id
  return doCurl("get","/entity/revisions/byRevisionID",params)
end

#getEntitySearch(what, entity_name, where, per_page, page, longitude, latitude, country, language) ⇒ Object

Search for matching entities

@param what
@param entity_name
@param where
@param per_page
@param page
@param longitude
@param latitude
@param country
@param language
@return - the data from the api


1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
# File 'lib/CentralIndex.rb', line 1357

def getEntitySearch( what, entity_name, where, per_page, page, longitude, latitude, country, language)
  params = Hash.new
  params['what'] = what
  params['entity_name'] = entity_name
  params['where'] = where
  params['per_page'] = per_page
  params['page'] = page
  params['longitude'] = longitude
  params['latitude'] = latitude
  params['country'] = country
  params['language'] = language
  return doCurl("get","/entity/search",params)
end

#getEntitySearchByboundingbox(latitude_1, longitude_1, latitude_2, longitude_2, per_page, page, country, language) ⇒ Object

Search for matching entities

@param latitude_1
@param longitude_1
@param latitude_2
@param longitude_2
@param per_page
@param page
@param country
@param language
@return - the data from the api


1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
# File 'lib/CentralIndex.rb', line 1385

def getEntitySearchByboundingbox( latitude_1, longitude_1, latitude_2, longitude_2, per_page, page, country, language)
  params = Hash.new
  params['latitude_1'] = latitude_1
  params['longitude_1'] = longitude_1
  params['latitude_2'] = latitude_2
  params['longitude_2'] = longitude_2
  params['per_page'] = per_page
  params['page'] = page
  params['country'] = country
  params['language'] = language
  return doCurl("get","/entity/search/byboundingbox",params)
end

#getEntitySearchBylocation(where, per_page, page, country, language) ⇒ Object

Search for matching entities

@param where - Location to search for results. E.g. Dublin e.g. Dublin
@param per_page - How many results per page
@param page - What page number to retrieve
@param country - Which country to return results for. An ISO compatible country code, E.g. ie
@param language - An ISO compatible language code, E.g. en
@return - the data from the api


1409
1410
1411
1412
1413
1414
1415
1416
1417
# File 'lib/CentralIndex.rb', line 1409

def getEntitySearchBylocation( where, per_page, page, country, language)
  params = Hash.new
  params['where'] = where
  params['per_page'] = per_page
  params['page'] = page
  params['country'] = country
  params['language'] = language
  return doCurl("get","/entity/search/bylocation",params)
end

#getEntitySearchWhat(what, per_page, page, country, language) ⇒ Object

Search for matching entities

@param what - What to get results for. E.g. Plumber e.g. plumber
@param per_page - Number of results returned per page
@param page - The page number to retrieve
@param country - Which country to return results for. An ISO compatible country code, E.g. ie e.g. ie
@param language - An ISO compatible language code, E.g. en
@return - the data from the api


1430
1431
1432
1433
1434
1435
1436
1437
1438
# File 'lib/CentralIndex.rb', line 1430

def getEntitySearchWhat( what, per_page, page, country, language)
  params = Hash.new
  params['what'] = what
  params['per_page'] = per_page
  params['page'] = page
  params['country'] = country
  params['language'] = language
  return doCurl("get","/entity/search/what",params)
end

#getEntitySearchWhatByboundingbox(what, latitude_1, longitude_1, latitude_2, longitude_2, per_page, page, country, language) ⇒ Object

Search for matching entities

@param what - What to get results for. E.g. Plumber e.g. plumber
@param latitude_1 - Latitude of first point in bounding box e.g. 53.396842
@param longitude_1 - Longitude of first point in bounding box e.g. -6.37619
@param latitude_2 - Latitude of second point in bounding box e.g. 53.290463
@param longitude_2 - Longitude of second point in bounding box e.g. -6.207275
@param per_page
@param page
@param country - A valid ISO 3166 country code e.g. ie
@param language
@return - the data from the api


1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
# File 'lib/CentralIndex.rb', line 1455

def getEntitySearchWhatByboundingbox( what, latitude_1, longitude_1, latitude_2, longitude_2, per_page, page, country, language)
  params = Hash.new
  params['what'] = what
  params['latitude_1'] = latitude_1
  params['longitude_1'] = longitude_1
  params['latitude_2'] = latitude_2
  params['longitude_2'] = longitude_2
  params['per_page'] = per_page
  params['page'] = page
  params['country'] = country
  params['language'] = language
  return doCurl("get","/entity/search/what/byboundingbox",params)
end

#getEntitySearchWhatBylocation(what, where, per_page, page, country, language) ⇒ Object

Search for matching entities

@param what - What to get results for. E.g. Plumber e.g. plumber
@param where - The location to get results for. E.g. Dublin e.g. Dublin
@param per_page - Number of results returned per page
@param page - Which page number to retrieve
@param country - Which country to return results for. An ISO compatible country code, E.g. ie e.g. ie
@param language - An ISO compatible language code, E.g. en
@return - the data from the api


1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
# File 'lib/CentralIndex.rb', line 1481

def getEntitySearchWhatBylocation( what, where, per_page, page, country, language)
  params = Hash.new
  params['what'] = what
  params['where'] = where
  params['per_page'] = per_page
  params['page'] = page
  params['country'] = country
  params['language'] = language
  return doCurl("get","/entity/search/what/bylocation",params)
end

#getEntitySearchWho(who, per_page, page, country) ⇒ Object

Search for matching entities

@param who - Company name e.g. Starbucks
@param per_page - How many results per page
@param page - What page number to retrieve
@param country - Which country to return results for. An ISO compatible country code, E.g. ie e.g. ie
@return - the data from the api


1502
1503
1504
1505
1506
1507
1508
1509
# File 'lib/CentralIndex.rb', line 1502

def getEntitySearchWho( who, per_page, page, country)
  params = Hash.new
  params['who'] = who
  params['per_page'] = per_page
  params['page'] = page
  params['country'] = country
  return doCurl("get","/entity/search/who",params)
end

#getEntitySearchWhoByboundingbox(who, latitude_1, longitude_1, latitude_2, longitude_2, per_page, page, country) ⇒ Object

Search for matching entities

@param who
@param latitude_1
@param longitude_1
@param latitude_2
@param longitude_2
@param per_page
@param page
@param country
@return - the data from the api


1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
# File 'lib/CentralIndex.rb', line 1525

def getEntitySearchWhoByboundingbox( who, latitude_1, longitude_1, latitude_2, longitude_2, per_page, page, country)
  params = Hash.new
  params['who'] = who
  params['latitude_1'] = latitude_1
  params['longitude_1'] = longitude_1
  params['latitude_2'] = latitude_2
  params['longitude_2'] = longitude_2
  params['per_page'] = per_page
  params['page'] = page
  params['country'] = country
  return doCurl("get","/entity/search/who/byboundingbox",params)
end

#getEntitySearchWhoBylocation(who, where, per_page, page, country) ⇒ Object

Search for matching entities

@param who - Company Name e.g. Starbucks
@param where - The location to get results for. E.g. Dublin e.g. Dublin
@param per_page - Number of results returned per page
@param page - Which page number to retrieve
@param country - Which country to return results for. An ISO compatible country code, E.g. ie e.g. ie
@return - the data from the api


1549
1550
1551
1552
1553
1554
1555
1556
1557
# File 'lib/CentralIndex.rb', line 1549

def getEntitySearchWhoBylocation( who, where, per_page, page, country)
  params = Hash.new
  params['who'] = who
  params['where'] = where
  params['per_page'] = per_page
  params['page'] = page
  params['country'] = country
  return doCurl("get","/entity/search/who/bylocation",params)
end

#getFlatpack(flatpack_id) ⇒ Object

Get a flatpack

@param flatpack_id - the unique id to search for
@return - the data from the api


1964
1965
1966
1967
1968
# File 'lib/CentralIndex.rb', line 1964

def getFlatpack( flatpack_id)
  params = Hash.new
  params['flatpack_id'] = flatpack_id
  return doCurl("get","/flatpack",params)
end

#getFlatpackBy_domain_name(domainName) ⇒ Object

Get a flatpack using a domain name

@param domainName - the domain name to search for
@return - the data from the api


1977
1978
1979
1980
1981
# File 'lib/CentralIndex.rb', line 1977

def getFlatpackBy_domain_name( domainName)
  params = Hash.new
  params['domainName'] = domainName
  return doCurl("get","/flatpack/by_domain_name",params)
end

#getFlatpackBy_masheryidObject

Get flatpacks that match the supplied masheryid

@return - the data from the api


1989
1990
1991
1992
# File 'lib/CentralIndex.rb', line 1989

def getFlatpackBy_masheryid()
  params = Hash.new
  return doCurl("get","/flatpack/by_masheryid",params)
end

#getGroup(group_id) ⇒ Object

Returns group that matches a given group id

@param group_id
@return - the data from the api


2110
2111
2112
2113
2114
# File 'lib/CentralIndex.rb', line 2110

def getGroup( group_id)
  params = Hash.new
  params['group_id'] = group_id
  return doCurl("get","/group",params)
end

#getLocation(location_id) ⇒ Object

Read a location with the supplied ID in the locations reference database.

@param location_id
@return - the data from the api


2123
2124
2125
2126
2127
# File 'lib/CentralIndex.rb', line 2123

def getLocation( location_id)
  params = Hash.new
  params['location_id'] = location_id
  return doCurl("get","/location",params)
end

#getLocationMultiple(location_ids) ⇒ Object

Read multiple locations with the supplied ID in the locations reference database.

@param location_ids
@return - the data from the api


2185
2186
2187
2188
2189
# File 'lib/CentralIndex.rb', line 2185

def getLocationMultiple( location_ids)
  params = Hash.new
  params['location_ids'] = location_ids
  return doCurl("get","/location/multiple",params)
end

#getLogo(a, b, c, d) ⇒ Object

Fetch the project logo, the symbol of the Wolf

@param a
@param b
@param c
@param d
@return - the data from the api


2254
2255
2256
2257
2258
2259
2260
2261
# File 'lib/CentralIndex.rb', line 2254

def ( a, b, c, d)
  params = Hash.new
  params['a'] = a
  params['b'] = b
  params['c'] = c
  params['d'] = d
  return doCurl("get","/logo",params)
end

#getLookupCategory(string, language) ⇒ Object

Find a category from cache or cloudant depending if it is in the cache

@param string - A string to search against, E.g. Plumbers
@param language - An ISO compatible language code, E.g. en
@return - the data from the api


2284
2285
2286
2287
2288
2289
# File 'lib/CentralIndex.rb', line 2284

def getLookupCategory( string, language)
  params = Hash.new
  params['string'] = string
  params['language'] = language
  return doCurl("get","/lookup/category",params)
end

#getLookupLegacyCategory(id, type) ⇒ Object

Find a category from a legacy ID or supplier (e.g. bill_moss)

@param id
@param type
@return - the data from the api


2299
2300
2301
2302
2303
2304
# File 'lib/CentralIndex.rb', line 2299

def getLookupLegacyCategory( id, type)
  params = Hash.new
  params['id'] = id
  params['type'] = type
  return doCurl("get","/lookup/legacy/category",params)
end

#getLookupLocation(string, country) ⇒ Object

Find a location from cache or cloudant depending if it is in the cache

@param string
@param country
@return - the data from the api


2314
2315
2316
2317
2318
2319
# File 'lib/CentralIndex.rb', line 2314

def getLookupLocation( string, country)
  params = Hash.new
  params['string'] = string
  params['country'] = country
  return doCurl("get","/lookup/location",params)
end

#getLookupLocationChildren(location_id, resolution) ⇒ Object

Find all the child locations of the selected location

@param location_id
@param resolution
@return - the data from the api


2329
2330
2331
2332
2333
2334
# File 'lib/CentralIndex.rb', line 2329

def getLookupLocationChildren( location_id, resolution)
  params = Hash.new
  params['location_id'] = location_id
  params['resolution'] = resolution
  return doCurl("get","/lookup/location/children",params)
end

#getLookupLocationParents(location_id) ⇒ Object

Find all the parents locations of the selected location

@param location_id
@return - the data from the api


2343
2344
2345
2346
2347
# File 'lib/CentralIndex.rb', line 2343

def getLookupLocationParents( location_id)
  params = Hash.new
  params['location_id'] = location_id
  return doCurl("get","/lookup/location/parents",params)
end

#getMatchBylocation(company_name, latitude, longitude, name_strictness, location_strictness) ⇒ Object

Find all matches by location and then return all matches that also match company name. Default location_strictness is set to 7, which equates to +/- 20m

@param company_name
@param latitude
@param longitude
@param name_strictness
@param location_strictness
@return - the data from the api


2360
2361
2362
2363
2364
2365
2366
2367
2368
# File 'lib/CentralIndex.rb', line 2360

def getMatchBylocation( company_name, latitude, longitude, name_strictness, location_strictness)
  params = Hash.new
  params['company_name'] = company_name
  params['latitude'] = latitude
  params['longitude'] = longitude
  params['name_strictness'] = name_strictness
  params['location_strictness'] = location_strictness
  return doCurl("get","/match/bylocation",params)
end

#getMatchByphone(phone, company_name, latitude, longitude, country, name_strictness, location_strictness) ⇒ Object

Find all matches by phone number and then return all matches that also match company name and location. Default location_strictness is defined in Km and the default is set to 0.2 (200m)

@param phone
@param company_name
@param latitude
@param longitude
@param country
@param name_strictness
@param location_strictness
@return - the data from the api


2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
# File 'lib/CentralIndex.rb', line 2383

def getMatchByphone( phone, company_name, latitude, longitude, country, name_strictness, location_strictness)
  params = Hash.new
  params['phone'] = phone
  params['company_name'] = company_name
  params['latitude'] = latitude
  params['longitude'] = longitude
  params['country'] = country
  params['name_strictness'] = name_strictness
  params['location_strictness'] = location_strictness
  return doCurl("get","/match/byphone",params)
end

#getMessage(message_id) ⇒ Object

Fetching a message

@param message_id - The message id to pull the message for
@return - the data from the api


2431
2432
2433
2434
2435
# File 'lib/CentralIndex.rb', line 2431

def getMessage( message_id)
  params = Hash.new
  params['message_id'] = message_id
  return doCurl("get","/message",params)
end

#getMessageBy_ses_id(ses_id) ⇒ Object

Fetching messages by ses_id

@param ses_id - The amazon id to pull the message for
@return - the data from the api


2444
2445
2446
2447
2448
# File 'lib/CentralIndex.rb', line 2444

def getMessageBy_ses_id( ses_id)
  params = Hash.new
  params['ses_id'] = ses_id
  return doCurl("get","/message/by_ses_id",params)
end

#getPrivate_objectAll(entity_id) ⇒ Object

Allows a private object to be returned based on the entity_id and masheryid

@param entity_id - The entity associated with the private object
@return - the data from the api


2485
2486
2487
2488
2489
# File 'lib/CentralIndex.rb', line 2485

def getPrivate_objectAll( entity_id)
  params = Hash.new
  params['entity_id'] = entity_id
  return doCurl("get","/private_object/all",params)
end

#getPublisher(publisher_id) ⇒ Object

Returns publisher that matches a given publisher id

@param publisher_id
@return - the data from the api


2498
2499
2500
2501
2502
# File 'lib/CentralIndex.rb', line 2498

def getPublisher( publisher_id)
  params = Hash.new
  params['publisher_id'] = publisher_id
  return doCurl("get","/publisher",params)
end

#getPublisherByCountry(country) ⇒ Object

Returns publisher that matches a given publisher id

@param country
@return - the data from the api


2545
2546
2547
2548
2549
# File 'lib/CentralIndex.rb', line 2545

def getPublisherByCountry( country)
  params = Hash.new
  params['country'] = country
  return doCurl("get","/publisher/byCountry",params)
end

#getPublisherByEntityId(entity_id) ⇒ Object

Returns publishers that are available for a given entity_id.

@param entity_id
@return - the data from the api


2558
2559
2560
2561
2562
# File 'lib/CentralIndex.rb', line 2558

def getPublisherByEntityId( entity_id)
  params = Hash.new
  params['entity_id'] = entity_id
  return doCurl("get","/publisher/byEntityId",params)
end

#getQueue(limit, queue_name) ⇒ Object

Retrieve queue items.

@param limit
@param queue_name
@return - the data from the api


2572
2573
2574
2575
2576
2577
# File 'lib/CentralIndex.rb', line 2572

def getQueue( limit, queue_name)
  params = Hash.new
  params['limit'] = limit
  params['queue_name'] = queue_name
  return doCurl("get","/queue",params)
end

#getQueueSearch(type, id) ⇒ Object

Find a queue item by its type and id

@param type
@param id
@return - the data from the api


2630
2631
2632
2633
2634
2635
# File 'lib/CentralIndex.rb', line 2630

def getQueueSearch( type, id)
  params = Hash.new
  params['type'] = type
  params['id'] = id
  return doCurl("get","/queue/search",params)
end

#getSales_log(sales_log_id) ⇒ Object

Return a sales log by id

@param sales_log_id - The sales log id to pull
@return - the data from the api


2692
2693
2694
2695
2696
# File 'lib/CentralIndex.rb', line 2692

def getSales_log( sales_log_id)
  params = Hash.new
  params['sales_log_id'] = sales_log_id
  return doCurl("get","/sales_log",params)
end

#getStatsEntityBy_date(entity_id, year, month) ⇒ Object

Get the number of times an entity has been served out as an advert or on serps/bdp pages

@param entity_id - A valid entity_id e.g. 379236608286720
@param year - The year to report on
@param month - The month to report on
@return - the data from the api


2726
2727
2728
2729
2730
2731
2732
# File 'lib/CentralIndex.rb', line 2726

def getStatsEntityBy_date( entity_id, year, month)
  params = Hash.new
  params['entity_id'] = entity_id
  params['year'] = year
  params['month'] = month
  return doCurl("get","/stats/entity/by_date",params)
end

#getStatusObject

Confirms that the API is active, and returns the current version number

@return - the data from the api


2740
2741
2742
2743
# File 'lib/CentralIndex.rb', line 2740

def getStatus()
  params = Hash.new
  return doCurl("get","/status",params)
end

#getTokenAdd(language, portal_name, country) ⇒ Object

Provides a tokenised URL to redirect a user so they can add an entity to Central Index

@param language - The language to use to render the add path e.g. en
@param portal_name - The name of the website that data is to be added on e.g. YourLocal
@param country - The country of the entity to be added e.g. gb
@return - the data from the api


2754
2755
2756
2757
2758
2759
2760
# File 'lib/CentralIndex.rb', line 2754

def getTokenAdd( language, portal_name, country)
  params = Hash.new
  params['language'] = language
  params['portal_name'] = portal_name
  params['country'] = country
  return doCurl("get","/token/add",params)
end

#getTokenClaim(entity_id, language, portal_name) ⇒ Object

Provides a tokenised URL to redirect a user to claim an entity on Central Index

@param entity_id - Entity ID to be claimed e.g. 380348266819584
@param language - The language to use to render the claim path e.g. en
@param portal_name - The name of the website that entity is being claimed on e.g. YourLocal
@return - the data from the api


2771
2772
2773
2774
2775
2776
2777
# File 'lib/CentralIndex.rb', line 2771

def getTokenClaim( entity_id, language, portal_name)
  params = Hash.new
  params['entity_id'] = entity_id
  params['language'] = language
  params['portal_name'] = portal_name
  return doCurl("get","/token/claim",params)
end

#getTokenDecode(token) ⇒ Object

Allows us to identify the user, entity and element from an encoded endpoint URL’s token

@param token
@return - the data from the api


2786
2787
2788
2789
2790
# File 'lib/CentralIndex.rb', line 2786

def getTokenDecode( token)
  params = Hash.new
  params['token'] = token
  return doCurl("get","/token/decode",params)
end

#getTokenLogin(portal_name, language) ⇒ Object

Fetch token for login path

@param portal_name - The name of the application that has initiated the  process, example: 'Your Local'
@param language - The language for the app
@return - the data from the api


2800
2801
2802
2803
2804
2805
# File 'lib/CentralIndex.rb', line 2800

def getTokenLogin( portal_name, language)
  params = Hash.new
  params['portal_name'] = portal_name
  params['language'] = language
  return doCurl("get","/token/login",params)
end

#getTokenMessage(entity_id, portal_name, language) ⇒ Object

Fetch token for messaging path

@param entity_id - The id of the entity being messaged
@param portal_name - The name of the application that has initiated the email process, example: 'Your Local'
@param language - The language for the app
@return - the data from the api


2816
2817
2818
2819
2820
2821
2822
# File 'lib/CentralIndex.rb', line 2816

def getTokenMessage( entity_id, portal_name, language)
  params = Hash.new
  params['entity_id'] = entity_id
  params['portal_name'] = portal_name
  params['language'] = language
  return doCurl("get","/token/message",params)
end

#getTokenReport(entity_id, portal_name, language) ⇒ Object

Provides a tokenised URL that allows a user to report incorrect entity information

@param entity_id - The unique Entity ID e.g. 379236608286720
@param portal_name - The name of the portal that the user is coming from e.g. YourLocal
@param language - The language to use to render the report path
@return - the data from the api


2833
2834
2835
2836
2837
2838
2839
# File 'lib/CentralIndex.rb', line 2833

def getTokenReport( entity_id, portal_name, language)
  params = Hash.new
  params['entity_id'] = entity_id
  params['portal_name'] = portal_name
  params['language'] = language
  return doCurl("get","/token/report",params)
end

#getTokenUpgrade(entity_id, portal_name, language, price, max_tags, max_locations, contract_length, ref_id) ⇒ Object

Fetch token for update path

@param entity_id - The id of the entity being upgraded
@param portal_name - The name of the application that has initiated the  process, example: 'Your Local'
@param language - The language for the app
@param price - The price of the advert in the entities native currency
@param max_tags - The number of tags attached to the advert
@param max_locations - The number of locations attached to the advert
@param contract_length - The number of days from the initial sale date that the contract is valid for
@param ref_id - The campaign or reference id
@return - the data from the api


2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
# File 'lib/CentralIndex.rb', line 2855

def getTokenUpgrade( entity_id, portal_name, language, price, max_tags, max_locations, contract_length, ref_id)
  params = Hash.new
  params['entity_id'] = entity_id
  params['portal_name'] = portal_name
  params['language'] = language
  params['price'] = price
  params['max_tags'] = max_tags
  params['max_locations'] = max_locations
  params['contract_length'] = contract_length
  params['ref_id'] = ref_id
  return doCurl("get","/token/upgrade",params)
end

#getToolsDocs(object, format) ⇒ Object

Use this call to get information (in HTML or JSON) about the data structure of given entity object (e.g. a phone number or an address)

@param object - The API call documentation is required for
@param format - The format of the returned data eg. JSON or HTML
@return - the data from the api


2876
2877
2878
2879
2880
2881
# File 'lib/CentralIndex.rb', line 2876

def getToolsDocs( object, format)
  params = Hash.new
  params['object'] = object
  params['format'] = format
  return doCurl("get","/tools/docs",params)
end

#getToolsFormatAddress(address, country) ⇒ Object

Format an address according to the rules of the country supplied

@param address - The address to format
@param country - The country where the address is based
@return - the data from the api


2891
2892
2893
2894
2895
2896
# File 'lib/CentralIndex.rb', line 2891

def getToolsFormatAddress( address, country)
  params = Hash.new
  params['address'] = address
  params['country'] = country
  return doCurl("get","/tools/format/address",params)
end

#getToolsFormatPhone(number, country) ⇒ Object

Format a phone number according to the rules of the country supplied

@param number - The telephone number to format
@param country - The country where the telephone number is based
@return - the data from the api


2906
2907
2908
2909
2910
2911
# File 'lib/CentralIndex.rb', line 2906

def getToolsFormatPhone( number, country)
  params = Hash.new
  params['number'] = number
  params['country'] = country
  return doCurl("get","/tools/format/phone",params)
end

#getToolsGeocode(building_number, address1, address2, address3, district, town, county, province, postcode, country) ⇒ Object

Supply an address to geocode - returns lat/lon and accuracy

@param building_number
@param address1
@param address2
@param address3
@param district
@param town
@param county
@param province
@param postcode
@param country
@return - the data from the api


2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
# File 'lib/CentralIndex.rb', line 2929

def getToolsGeocode( building_number, address1, address2, address3, district, town, county, province, postcode, country)
  params = Hash.new
  params['building_number'] = building_number
  params['address1'] = address1
  params['address2'] = address2
  params['address3'] = address3
  params['district'] = district
  params['town'] = town
  params['county'] = county
  params['province'] = province
  params['postcode'] = postcode
  params['country'] = country
  return doCurl("get","/tools/geocode",params)
end

#getToolsIodocs(mode, path, endpoint, doctype) ⇒ Object

Generate JSON in the format to generate Mashery’s IODocs

@param mode - The HTTP method of the API call to document. e.g. GET
@param path - The path of the API call to document e.g, /entity
@param endpoint - The Mashery 'endpoint' to prefix to our API paths e.g. v1
@param doctype - Mashery has two forms of JSON to describe API methods; one on github, the other on its customer dashboard
@return - the data from the api


2969
2970
2971
2972
2973
2974
2975
2976
# File 'lib/CentralIndex.rb', line 2969

def getToolsIodocs( mode, path, endpoint, doctype)
  params = Hash.new
  params['mode'] = mode
  params['path'] = path
  params['endpoint'] = endpoint
  params['doctype'] = doctype
  return doCurl("get","/tools/iodocs",params)
end

#getToolsLess(less) ⇒ Object

compile the supplied less with the standard Bootstrap less into a CSS file

@param less - The LESS code to compile
@return - the data from the api


2985
2986
2987
2988
2989
# File 'lib/CentralIndex.rb', line 2985

def getToolsLess( less)
  params = Hash.new
  params['less'] = less
  return doCurl("get","/tools/less",params)
end

#getToolsPhonecallVerify(to, from, pin, language) ⇒ Object

Ring the person and verify their account

@param to - The phone number to verify
@param from - The phone number to call from
@param pin - The pin to verify the phone number with
@param language - The language to read the verification in
@return - the data from the api


3001
3002
3003
3004
3005
3006
3007
3008
# File 'lib/CentralIndex.rb', line 3001

def getToolsPhonecallVerify( to, from, pin, language)
  params = Hash.new
  params['to'] = to
  params['from'] = from
  params['pin'] = pin
  params['language'] = language
  return doCurl("get","/tools/phonecall/verify",params)
end

#getToolsPhonetic(text) ⇒ Object

Return the phonetic representation of a string

@param text
@return - the data from the api


3017
3018
3019
3020
3021
# File 'lib/CentralIndex.rb', line 3017

def getToolsPhonetic( text)
  params = Hash.new
  params['text'] = text
  return doCurl("get","/tools/phonetic",params)
end

#getToolsProcess_phone(number) ⇒ Object

Attempt to process a phone number, removing anything which is not a digit

@param number
@return - the data from the api


3030
3031
3032
3033
3034
# File 'lib/CentralIndex.rb', line 3030

def getToolsProcess_phone( number)
  params = Hash.new
  params['number'] = number
  return doCurl("get","/tools/process_phone",params)
end

#getToolsProcess_string(text) ⇒ Object

Fully process a string. This includes removing punctuation, stops words and stemming a string. Also returns the phonetic representation of this string.

@param text
@return - the data from the api


3043
3044
3045
3046
3047
# File 'lib/CentralIndex.rb', line 3043

def getToolsProcess_string( text)
  params = Hash.new
  params['text'] = text
  return doCurl("get","/tools/process_string",params)
end

#getToolsReindexObject

Force refresh of search indexes

@return - the data from the api


3055
3056
3057
3058
# File 'lib/CentralIndex.rb', line 3055

def getToolsReindex()
  params = Hash.new
  return doCurl("get","/tools/reindex",params)
end

#getToolsReplace(entity_id, string) ⇒ Object

replace some text parameters with some entity details

@param entity_id - The entity to pull for replacements
@param string - The string full of parameters
@return - the data from the api


3068
3069
3070
3071
3072
3073
# File 'lib/CentralIndex.rb', line 3068

def getToolsReplace( entity_id, string)
  params = Hash.new
  params['entity_id'] = entity_id
  params['string'] = string
  return doCurl("get","/tools/replace",params)
end

#getToolsSendsms(from, to, message) ⇒ Object

Check to see if a supplied email address is valid

@param from - The phone number from which the SMS orginates
@param to - The phone number to which the SMS is to be sent
@param message - The message to be sent in the SMS
@return - the data from the api


3084
3085
3086
3087
3088
3089
3090
# File 'lib/CentralIndex.rb', line 3084

def getToolsSendsms( from, to, message)
  params = Hash.new
  params['from'] = from
  params['to'] = to
  params['message'] = message
  return doCurl("get","/tools/sendsms",params)
end

#getToolsSpider(url, pages, country) ⇒ Object

Spider a single url looking for key facts

@param url
@param pages
@param country
@return - the data from the api


3101
3102
3103
3104
3105
3106
3107
# File 'lib/CentralIndex.rb', line 3101

def getToolsSpider( url, pages, country)
  params = Hash.new
  params['url'] = url
  params['pages'] = pages
  params['country'] = country
  return doCurl("get","/tools/spider",params)
end

#getToolsStem(text) ⇒ Object

Returns a stemmed version of a string

@param text
@return - the data from the api


3116
3117
3118
3119
3120
# File 'lib/CentralIndex.rb', line 3116

def getToolsStem( text)
  params = Hash.new
  params['text'] = text
  return doCurl("get","/tools/stem",params)
end

#getToolsStopwords(text) ⇒ Object

Removes stopwords from a string

@param text
@return - the data from the api


3129
3130
3131
3132
3133
# File 'lib/CentralIndex.rb', line 3129

def getToolsStopwords( text)
  params = Hash.new
  params['text'] = text
  return doCurl("get","/tools/stopwords",params)
end

#getToolsValidate_email(email_address) ⇒ Object

Check to see if a supplied email address is valid

@param email_address - The email address to validate
@return - the data from the api


3142
3143
3144
3145
3146
# File 'lib/CentralIndex.rb', line 3142

def getToolsValidate_email( email_address)
  params = Hash.new
  params['email_address'] = email_address
  return doCurl("get","/tools/validate_email",params)
end

#getTraction(traction_id) ⇒ Object

Fetching a traction

@param traction_id
@return - the data from the api


3155
3156
3157
3158
3159
# File 'lib/CentralIndex.rb', line 3155

def getTraction( traction_id)
  params = Hash.new
  params['traction_id'] = traction_id
  return doCurl("get","/traction",params)
end

#getTractionActiveObject

Fetching active tractions

@return - the data from the api


3213
3214
3215
3216
# File 'lib/CentralIndex.rb', line 3213

def getTractionActive()
  params = Hash.new
  return doCurl("get","/traction/active",params)
end

#getTransaction(transaction_id) ⇒ Object

Given a transaction_id retrieve information on it

@param transaction_id
@return - the data from the api


3225
3226
3227
3228
3229
# File 'lib/CentralIndex.rb', line 3225

def getTransaction( transaction_id)
  params = Hash.new
  params['transaction_id'] = transaction_id
  return doCurl("get","/transaction",params)
end

#getTransactionBy_paypal_transaction_id(paypal_transaction_id) ⇒ Object

Given a transaction_id retrieve information on it

@param paypal_transaction_id
@return - the data from the api


3276
3277
3278
3279
3280
# File 'lib/CentralIndex.rb', line 3276

def getTransactionBy_paypal_transaction_id( paypal_transaction_id)
  params = Hash.new
  params['paypal_transaction_id'] = paypal_transaction_id
  return doCurl("get","/transaction/by_paypal_transaction_id",params)
end

#getUser(user_id) ⇒ Object

With a unique ID address an user can be retrieved

@param user_id
@return - the data from the api


3336
3337
3338
3339
3340
# File 'lib/CentralIndex.rb', line 3336

def getUser( user_id)
  params = Hash.new
  params['user_id'] = user_id
  return doCurl("get","/user",params)
end

#getUserBy_email(email) ⇒ Object

With a unique email address an user can be retrieved

@param email
@return - the data from the api


3380
3381
3382
3383
3384
# File 'lib/CentralIndex.rb', line 3380

def getUserBy_email( email)
  params = Hash.new
  params['email'] = email
  return doCurl("get","/user/by_email",params)
end

#getUserBy_reseller_admin_masheryid(reseller_admin_masheryid) ⇒ Object

Returns all the users that match the supplied reseller_admin_masheryid

@param reseller_admin_masheryid
@return - the data from the api


3393
3394
3395
3396
3397
# File 'lib/CentralIndex.rb', line 3393

def getUserBy_reseller_admin_masheryid( reseller_admin_masheryid)
  params = Hash.new
  params['reseller_admin_masheryid'] = reseller_admin_masheryid
  return doCurl("get","/user/by_reseller_admin_masheryid",params)
end

#getUserBy_social_media(name, id) ⇒ Object

With a unique ID address an user can be retrieved

@param name
@param id
@return - the data from the api


3407
3408
3409
3410
3411
3412
# File 'lib/CentralIndex.rb', line 3407

def getUserBy_social_media( name, id)
  params = Hash.new
  params['name'] = name
  params['id'] = id
  return doCurl("get","/user/by_social_media",params)
end

#postCategoryMappings(category_id, type, id, name) ⇒ Object

With a known category id, a mapping object can be added.

@param category_id
@param type
@param id
@param name
@return - the data from the api


238
239
240
241
242
243
244
245
# File 'lib/CentralIndex.rb', line 238

def ( category_id, type, id, name)
  params = Hash.new
  params['category_id'] = category_id
  params['type'] = type
  params['id'] = id
  params['name'] = name
  return doCurl("post","/category/mappings",params)
end

#postCategoryMerge(from, to) ⇒ Object

Allows a category object to merged with another

@param from
@param to
@return - the data from the api


255
256
257
258
259
260
# File 'lib/CentralIndex.rb', line 255

def ( from, to)
  params = Hash.new
  params['from'] = from
  params['to'] = to
  return doCurl("post","/category/merge",params)
end

#postCategorySynonym(category_id, synonym, language) ⇒ Object

With a known category id, an synonym object can be added.

@param category_id
@param synonym
@param language
@return - the data from the api


288
289
290
291
292
293
294
# File 'lib/CentralIndex.rb', line 288

def ( category_id, synonym, language)
  params = Hash.new
  params['category_id'] = category_id
  params['synonym'] = synonym
  params['language'] = language
  return doCurl("post","/category/synonym",params)
end

#postCountry(country_id, name, synonyms, continentName, continent, geonameId, dbpediaURL, freebaseURL, population, currencyCode, languages, areaInSqKm, capital, east, west, north, south, claimPrice, claimMethods, nokia_country_code, twilio_sms, twilio_phone) ⇒ Object

Update/Add a country

@param country_id
@param name
@param synonyms
@param continentName
@param continent
@param geonameId
@param dbpediaURL
@param freebaseURL
@param population
@param currencyCode
@param languages
@param areaInSqKm
@param capital
@param east
@param west
@param north
@param south
@param claimPrice
@param claimMethods
@param nokia_country_code
@param twilio_sms
@param twilio_phone
@return - the data from the api


324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
# File 'lib/CentralIndex.rb', line 324

def postCountry( country_id, name, synonyms, continentName, continent, geonameId, dbpediaURL, freebaseURL, population, currencyCode, languages, areaInSqKm, capital, east, west, north, south, claimPrice, claimMethods, nokia_country_code, twilio_sms, twilio_phone)
  params = Hash.new
  params['country_id'] = country_id
  params['name'] = name
  params['synonyms'] = synonyms
  params['continentName'] = continentName
  params['continent'] = continent
  params['geonameId'] = geonameId
  params['dbpediaURL'] = dbpediaURL
  params['freebaseURL'] = freebaseURL
  params['population'] = population
  params['currencyCode'] = currencyCode
  params['languages'] = languages
  params['areaInSqKm'] = areaInSqKm
  params['capital'] = capital
  params['east'] = east
  params['west'] = west
  params['north'] = north
  params['south'] = south
  params['claimPrice'] = claimPrice
  params['claimMethods'] = claimMethods
  params['nokia_country_code'] = nokia_country_code
  params['twilio_sms'] = twilio_sms
  params['twilio_phone'] = twilio_phone
  return doCurl("post","/country",params)
end

#postEmail(to_email_address, reply_email_address, source_account, subject, body, html_body) ⇒ Object

Send an email via amazon

@param to_email_address - The email address to send the email too
@param reply_email_address - The email address to add in the reply to field
@param  - The source  to send the email from
@param subject - The subject for the email
@param body - The body for the email
@param html_body - If the body of the email is html
@return - the data from the api


376
377
378
379
380
381
382
383
384
385
# File 'lib/CentralIndex.rb', line 376

def postEmail( to_email_address, reply_email_address, , subject, body, html_body)
  params = Hash.new
  params['to_email_address'] = to_email_address
  params['reply_email_address'] = reply_email_address
  params['source_account'] = 
  params['subject'] = subject
  params['body'] = body
  params['html_body'] = html_body
  return doCurl("post","/email",params)
end

#postEntityAdvertiserCancel(entity_id, publisher_id, reseller_ref, reseller_agent_id) ⇒ Object

Expires an advertiser from and entity

@param entity_id
@param publisher_id
@param reseller_ref
@param reseller_agent_id
@return - the data from the api


446
447
448
449
450
451
452
453
# File 'lib/CentralIndex.rb', line 446

def postEntityAdvertiserCancel( entity_id, publisher_id, reseller_ref, reseller_agent_id)
  params = Hash.new
  params['entity_id'] = entity_id
  params['publisher_id'] = publisher_id
  params['reseller_ref'] = reseller_ref
  params['reseller_agent_id'] = reseller_agent_id
  return doCurl("post","/entity/advertiser/cancel",params)
end

#postEntityAdvertiserCreate(entity_id, tags, locations, max_tags, max_locations, expiry_date, is_national, language, reseller_ref, reseller_agent_id, publisher_id) ⇒ Object

With a known entity id, a advertiser is added

@param entity_id
@param tags
@param locations
@param max_tags
@param max_locations
@param expiry_date
@param is_national
@param language
@param reseller_ref
@param reseller_agent_id
@param publisher_id
@return - the data from the api


472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
# File 'lib/CentralIndex.rb', line 472

def postEntityAdvertiserCreate( entity_id, tags, locations, max_tags, max_locations, expiry_date, is_national, language, reseller_ref, reseller_agent_id, publisher_id)
  params = Hash.new
  params['entity_id'] = entity_id
  params['tags'] = tags
  params['locations'] = locations
  params['max_tags'] = max_tags
  params['max_locations'] = max_locations
  params['expiry_date'] = expiry_date
  params['is_national'] = is_national
  params['language'] = language
  params['reseller_ref'] = reseller_ref
  params['reseller_agent_id'] = reseller_agent_id
  params['publisher_id'] = publisher_id
  return doCurl("post","/entity/advertiser/create",params)
end

#postEntityAdvertiserLocation(entity_id, gen_id, locations_to_add, locations_to_remove) ⇒ Object

Adds/removes locations

@param entity_id
@param gen_id
@param locations_to_add
@param locations_to_remove
@return - the data from the api


498
499
500
501
502
503
504
505
# File 'lib/CentralIndex.rb', line 498

def postEntityAdvertiserLocation( entity_id, gen_id, locations_to_add, locations_to_remove)
  params = Hash.new
  params['entity_id'] = entity_id
  params['gen_id'] = gen_id
  params['locations_to_add'] = locations_to_add
  params['locations_to_remove'] = locations_to_remove
  return doCurl("post","/entity/advertiser/location",params)
end

#postEntityAdvertiserRenew(entity_id, expiry_date, publisher_id, reseller_ref, reseller_agent_id) ⇒ Object

Renews an advertiser from an entity

@param entity_id
@param expiry_date
@param publisher_id
@param reseller_ref
@param reseller_agent_id
@return - the data from the api


518
519
520
521
522
523
524
525
526
# File 'lib/CentralIndex.rb', line 518

def postEntityAdvertiserRenew( entity_id, expiry_date, publisher_id, reseller_ref, reseller_agent_id)
  params = Hash.new
  params['entity_id'] = entity_id
  params['expiry_date'] = expiry_date
  params['publisher_id'] = publisher_id
  params['reseller_ref'] = reseller_ref
  params['reseller_agent_id'] = reseller_agent_id
  return doCurl("post","/entity/advertiser/renew",params)
end

#postEntityAdvertiserTag(gen_id, entity_id, language, tags_to_add, tags_to_remove) ⇒ Object

Allows the removal or insertion of tags into an advertiser object

@param gen_id - The gen_id of this advertiser
@param entity_id - The entity_id of the advertiser
@param language - The tag language to alter
@param tags_to_add - The tags to add
@param tags_to_remove - The tags to remove
@return - the data from the api


539
540
541
542
543
544
545
546
547
# File 'lib/CentralIndex.rb', line 539

def postEntityAdvertiserTag( gen_id, entity_id, language, tags_to_add, tags_to_remove)
  params = Hash.new
  params['gen_id'] = gen_id
  params['entity_id'] = entity_id
  params['language'] = language
  params['tags_to_add'] = tags_to_add
  params['tags_to_remove'] = tags_to_remove
  return doCurl("post","/entity/advertiser/tag",params)
end

#postEntityAdvertiserUpsell(entity_id, tags, locations, extra_tags, extra_locations, is_national, language, reseller_ref, reseller_agent_id, publisher_id) ⇒ Object

With a known entity id, an advertiser is updated

@param entity_id
@param tags
@param locations
@param extra_tags
@param extra_locations
@param is_national
@param language
@param reseller_ref
@param reseller_agent_id
@param publisher_id
@return - the data from the api


565
566
567
568
569
570
571
572
573
574
575
576
577
578
# File 'lib/CentralIndex.rb', line 565

def postEntityAdvertiserUpsell( entity_id, tags, locations, extra_tags, extra_locations, is_national, language, reseller_ref, reseller_agent_id, publisher_id)
  params = Hash.new
  params['entity_id'] = entity_id
  params['tags'] = tags
  params['locations'] = locations
  params['extra_tags'] = extra_tags
  params['extra_locations'] = extra_locations
  params['is_national'] = is_national
  params['language'] = language
  params['reseller_ref'] = reseller_ref
  params['reseller_agent_id'] = reseller_agent_id
  params['publisher_id'] = publisher_id
  return doCurl("post","/entity/advertiser/upsell",params)
end

With a known entity id, an affiliate link object can be added.

@param entity_id
@param affiliate_name
@param affiliate_link
@param affiliate_message
@param 
@return - the data from the api


612
613
614
615
616
617
618
619
620
# File 'lib/CentralIndex.rb', line 612

def postEntityAffiliate_link( entity_id, affiliate_name, affiliate_link, affiliate_message, )
  params = Hash.new
  params['entity_id'] = entity_id
  params['affiliate_name'] = affiliate_name
  params['affiliate_link'] = affiliate_link
  params['affiliate_message'] = affiliate_message
  params['affiliate_logo'] = 
  return doCurl("post","/entity/affiliate_link",params)
end

#postEntityBackground(entity_id, number_of_employees, turnover, net_profit, vat_number, duns_number, registered_company_number) ⇒ Object

With a known entity id, an background object can be added. There can however only be one background object.

@param entity_id
@param number_of_employees
@param turnover
@param net_profit
@param vat_number
@param duns_number
@param registered_company_number
@return - the data from the api


650
651
652
653
654
655
656
657
658
659
660
# File 'lib/CentralIndex.rb', line 650

def postEntityBackground( entity_id, number_of_employees, turnover, net_profit, vat_number, duns_number, registered_company_number)
  params = Hash.new
  params['entity_id'] = entity_id
  params['number_of_employees'] = number_of_employees
  params['turnover'] = turnover
  params['net_profit'] = net_profit
  params['vat_number'] = vat_number
  params['duns_number'] = duns_number
  params['registered_company_number'] = registered_company_number
  return doCurl("post","/entity/background",params)
end

#postEntityBulkCsv(filedata) ⇒ Object

Uploads a CSV file of known format and bulk inserts into DB

@param filedata
@return - the data from the api


669
670
671
672
673
# File 'lib/CentralIndex.rb', line 669

def postEntityBulkCsv( filedata)
  params = Hash.new
  params['filedata'] = filedata
  return doCurl("post","/entity/bulk/csv",params)
end

#postEntityBulkJson(data) ⇒ Object

Uploads a JSON file of known format and bulk inserts into DB

@param data
@return - the data from the api


695
696
697
698
699
# File 'lib/CentralIndex.rb', line 695

def postEntityBulkJson( data)
  params = Hash.new
  params['data'] = data
  return doCurl("post","/entity/bulk/json",params)
end

#postEntityCategory(entity_id, category_id, category_type) ⇒ Object

With a known entity id, an category object can be added.

@param entity_id
@param category_id
@param category_type
@return - the data from the api


764
765
766
767
768
769
770
# File 'lib/CentralIndex.rb', line 764

def postEntityCategory( entity_id, category_id, category_type)
  params = Hash.new
  params['entity_id'] = entity_id
  params['category_id'] = category_id
  params['category_type'] = category_type
  return doCurl("post","/entity/category",params)
end

#postEntityClaim(entity_id, claimed_user_id, claimed_date, claim_method, phone_number) ⇒ Object

Allow an entity to be claimed by a valid user

@param entity_id
@param claimed_user_id
@param claimed_date
@param claim_method
@param phone_number
@return - the data from the api


796
797
798
799
800
801
802
803
804
# File 'lib/CentralIndex.rb', line 796

def postEntityClaim( entity_id, claimed_user_id, claimed_date, claim_method, phone_number)
  params = Hash.new
  params['entity_id'] = entity_id
  params['claimed_user_id'] = claimed_user_id
  params['claimed_date'] = claimed_date
  params['claim_method'] = claim_method
  params['phone_number'] = phone_number
  return doCurl("post","/entity/claim",params)
end

#postEntityDescription(entity_id, headline, body) ⇒ Object

With a known entity id, a description object can be added.

@param entity_id
@param headline
@param body
@return - the data from the api


830
831
832
833
834
835
836
# File 'lib/CentralIndex.rb', line 830

def postEntityDescription( entity_id, headline, body)
  params = Hash.new
  params['entity_id'] = entity_id
  params['headline'] = headline
  params['body'] = body
  return doCurl("post","/entity/description",params)
end

#postEntityDocument(entity_id, name, filedata) ⇒ Object

With a known entity id, an document object can be added.

@param entity_id
@param name
@param filedata
@return - the data from the api


847
848
849
850
851
852
853
# File 'lib/CentralIndex.rb', line 847

def postEntityDocument( entity_id, name, filedata)
  params = Hash.new
  params['entity_id'] = entity_id
  params['name'] = name
  params['filedata'] = filedata
  return doCurl("post","/entity/document",params)
end

#postEntityEmail(entity_id, email_address, email_description) ⇒ Object

With a known entity id, an email address object can be added.

@param entity_id
@param email_address
@param email_description
@return - the data from the api


894
895
896
897
898
899
900
# File 'lib/CentralIndex.rb', line 894

def postEntityEmail( entity_id, email_address, email_description)
  params = Hash.new
  params['entity_id'] = entity_id
  params['email_address'] = email_address
  params['email_description'] = email_description
  return doCurl("post","/entity/email",params)
end

#postEntityEmployee(entity_id, title, forename, surname, job_title, description, email, phone_number) ⇒ Object

With a known entity id, an employee object can be added.

@param entity_id
@param title
@param forename
@param surname
@param job_title
@param description
@param email
@param phone_number
@return - the data from the api


916
917
918
919
920
921
922
923
924
925
926
927
# File 'lib/CentralIndex.rb', line 916

def postEntityEmployee( entity_id, title, forename, surname, job_title, description, email, phone_number)
  params = Hash.new
  params['entity_id'] = entity_id
  params['title'] = title
  params['forename'] = forename
  params['surname'] = surname
  params['job_title'] = job_title
  params['description'] = description
  params['email'] = email
  params['phone_number'] = phone_number
  return doCurl("post","/entity/employee",params)
end

#postEntityFax(entity_id, number, description) ⇒ Object

With a known entity id, an fax object can be added.

@param entity_id
@param number
@param description
@return - the data from the api


968
969
970
971
972
973
974
# File 'lib/CentralIndex.rb', line 968

def postEntityFax( entity_id, number, description)
  params = Hash.new
  params['entity_id'] = entity_id
  params['number'] = number
  params['description'] = description
  return doCurl("post","/entity/fax",params)
end

#postEntityGeopoint(entity_id, longitude, latitude, accuracy) ⇒ Object

With a known entity id, a geopoint can be updated.

@param entity_id
@param longitude
@param latitude
@param accuracy
@return - the data from the api


986
987
988
989
990
991
992
993
# File 'lib/CentralIndex.rb', line 986

def postEntityGeopoint( entity_id, longitude, latitude, accuracy)
  params = Hash.new
  params['entity_id'] = entity_id
  params['longitude'] = longitude
  params['latitude'] = latitude
  params['accuracy'] = accuracy
  return doCurl("post","/entity/geopoint",params)
end

#postEntityGroup(entity_id, group_id) ⇒ Object

With a known entity id, a group can be added to group members.

@param entity_id
@param group_id
@return - the data from the api


1003
1004
1005
1006
1007
1008
# File 'lib/CentralIndex.rb', line 1003

def postEntityGroup( entity_id, group_id)
  params = Hash.new
  params['entity_id'] = entity_id
  params['group_id'] = group_id
  return doCurl("post","/entity/group",params)
end

#postEntityImage(entity_id, filedata, image_name) ⇒ Object

With a known entity id, a image object can be added.

@param entity_id
@param filedata
@param image_name
@return - the data from the api


1034
1035
1036
1037
1038
1039
1040
# File 'lib/CentralIndex.rb', line 1034

def postEntityImage( entity_id, filedata, image_name)
  params = Hash.new
  params['entity_id'] = entity_id
  params['filedata'] = filedata
  params['image_name'] = image_name
  return doCurl("post","/entity/image",params)
end

#postEntityInvoice_address(entity_id, building_number, address1, address2, address3, district, town, county, province, postcode, address_type) ⇒ Object

With a known entity id, an invoice_address object can be updated.

@param entity_id
@param building_number
@param address1
@param address2
@param address3
@param district
@param town
@param county
@param province
@param postcode
@param address_type
@return - the data from the api


1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
# File 'lib/CentralIndex.rb', line 1087

def postEntityInvoice_address( entity_id, building_number, address1, address2, address3, district, town, county, province, postcode, address_type)
  params = Hash.new
  params['entity_id'] = entity_id
  params['building_number'] = building_number
  params['address1'] = address1
  params['address2'] = address2
  params['address3'] = address3
  params['district'] = district
  params['town'] = town
  params['county'] = county
  params['province'] = province
  params['postcode'] = postcode
  params['address_type'] = address_type
  return doCurl("post","/entity/invoice_address",params)
end

#postEntityList(entity_id, headline, body) ⇒ Object

With a known entity id, a list description object can be added.

@param entity_id
@param headline
@param body
@return - the data from the api


1127
1128
1129
1130
1131
1132
1133
# File 'lib/CentralIndex.rb', line 1127

def postEntityList( entity_id, headline, body)
  params = Hash.new
  params['entity_id'] = entity_id
  params['headline'] = headline
  params['body'] = body
  return doCurl("post","/entity/list",params)
end

#postEntityLogo(entity_id, filedata, logo_name) ⇒ Object

With a known entity id, a logo object can be added.

@param entity_id
@param filedata
@param logo_name
@return - the data from the api


1144
1145
1146
1147
1148
1149
1150
# File 'lib/CentralIndex.rb', line 1144

def ( entity_id, filedata, logo_name)
  params = Hash.new
  params['entity_id'] = entity_id
  params['filedata'] = filedata
  params['logo_name'] = logo_name
  return doCurl("post","/entity/logo",params)
end

#postEntityMerge(from, to) ⇒ Object

Merge two entities into one

@param from
@param to
@return - the data from the api


1175
1176
1177
1178
1179
1180
# File 'lib/CentralIndex.rb', line 1175

def postEntityMerge( from, to)
  params = Hash.new
  params['from'] = from
  params['to'] = to
  return doCurl("post","/entity/merge",params)
end

#postEntityMigrate_category(from, to, limit) ⇒ Object

Update entities that use an old category ID to a new one

@param from
@param to
@param limit
@return - the data from the api


1191
1192
1193
1194
1195
1196
1197
# File 'lib/CentralIndex.rb', line 1191

def postEntityMigrate_category( from, to, limit)
  params = Hash.new
  params['from'] = from
  params['to'] = to
  params['limit'] = limit
  return doCurl("post","/entity/migrate_category",params)
end

#postEntityName(entity_id, name, formal_name) ⇒ Object

With a known entity id, a name can be updated.

@param entity_id
@param name
@param formal_name
@return - the data from the api


1208
1209
1210
1211
1212
1213
1214
# File 'lib/CentralIndex.rb', line 1208

def postEntityName( entity_id, name, formal_name)
  params = Hash.new
  params['entity_id'] = entity_id
  params['name'] = name
  params['formal_name'] = formal_name
  return doCurl("post","/entity/name",params)
end

#postEntityOpening_times(entity_id, monday, tuesday, wednesday, thursday, friday, saturday, sunday, closed, closed_public_holidays) ⇒ Object

With a known entity id, a opening times object can be added. Each day can be either ‘closed’ to indicate that the entity is closed that day, ‘24hour’ to indicate that the entity is open all day or single/split time ranges can be supplied in 4-digit 24-hour format, such as ‘09001730’ or ‘09001200,13001700’ to indicate hours of opening.

@param entity_id - The id of the entity to edit
@param monday - e.g. 'closed', '24hour' , '09001730' , '09001200,13001700'
@param tuesday - e.g. 'closed', '24hour' , '09001730' , '09001200,13001700'
@param wednesday - e.g. 'closed', '24hour' , '09001730' , '09001200,13001700'
@param thursday - e.g. 'closed', '24hour' , '09001730' , '09001200,13001700'
@param friday - e.g. 'closed', '24hour' , '09001730' , '09001200,13001700'
@param saturday - e.g. 'closed', '24hour' , '09001730' , '09001200,13001700'
@param sunday - e.g. 'closed', '24hour' , '09001730' , '09001200,13001700'
@param closed - a comma-separated list of dates that the entity is closed e.g. '2013-04-29,2013-05-02'
@param closed_public_holidays - whether the entity is closed on public holidays
@return - the data from the api


1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
# File 'lib/CentralIndex.rb', line 1232

def postEntityOpening_times( entity_id, monday, tuesday, wednesday, thursday, friday, saturday, sunday, closed, closed_public_holidays)
  params = Hash.new
  params['entity_id'] = entity_id
  params['monday'] = monday
  params['tuesday'] = tuesday
  params['wednesday'] = wednesday
  params['thursday'] = thursday
  params['friday'] = friday
  params['saturday'] = saturday
  params['sunday'] = sunday
  params['closed'] = closed
  params['closed_public_holidays'] = closed_public_holidays
  return doCurl("post","/entity/opening_times",params)
end

#postEntityPhone(entity_id, number, description) ⇒ Object

Allows a new phone object to be added to a specified entity. A new object id will be calculated and returned to you if successful.

@param entity_id
@param number
@param description
@return - the data from the api


1256
1257
1258
1259
1260
1261
1262
# File 'lib/CentralIndex.rb', line 1256

def postEntityPhone( entity_id, number, description)
  params = Hash.new
  params['entity_id'] = entity_id
  params['number'] = number
  params['description'] = description
  return doCurl("post","/entity/phone",params)
end

#postEntityPostal_address(entity_id, building_number, address1, address2, address3, district, town, county, province, postcode, address_type, do_not_display) ⇒ Object

Create/Update a postal address

@param entity_id
@param building_number
@param address1
@param address2
@param address3
@param district
@param town
@param county
@param province
@param postcode
@param address_type
@param do_not_display
@return - the data from the api


1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
# File 'lib/CentralIndex.rb', line 1297

def postEntityPostal_address( entity_id, building_number, address1, address2, address3, district, town, county, province, postcode, address_type, do_not_display)
  params = Hash.new
  params['entity_id'] = entity_id
  params['building_number'] = building_number
  params['address1'] = address1
  params['address2'] = address2
  params['address3'] = address3
  params['district'] = district
  params['town'] = town
  params['county'] = county
  params['province'] = province
  params['postcode'] = postcode
  params['address_type'] = address_type
  params['do_not_display'] = do_not_display
  return doCurl("post","/entity/postal_address",params)
end

#postEntitySend_email(entity_id, gen_id, from_email, subject, content) ⇒ Object

Send an email to an email address specified in an entity

@param entity_id - The entity id of the entity you wish to contact
@param gen_id - The gen_id of the email address you wish to send the message to
@param from_email - The email of the person sending the message 
@param subject - The subject for the email
@param content - The content of the email
@return - the data from the api


1570
1571
1572
1573
1574
1575
1576
1577
1578
# File 'lib/CentralIndex.rb', line 1570

def postEntitySend_email( entity_id, gen_id, from_email, subject, content)
  params = Hash.new
  params['entity_id'] = entity_id
  params['gen_id'] = gen_id
  params['from_email'] = from_email
  params['subject'] = subject
  params['content'] = content
  return doCurl("post","/entity/send_email",params)
end

#postEntitySocialmedia(entity_id, type, website_url) ⇒ Object

With a known entity id, a social media object can be added.

@param entity_id
@param type
@param website_url
@return - the data from the api


1589
1590
1591
1592
1593
1594
1595
# File 'lib/CentralIndex.rb', line 1589

def postEntitySocialmedia( entity_id, type, website_url)
  params = Hash.new
  params['entity_id'] = entity_id
  params['type'] = type
  params['website_url'] = website_url
  return doCurl("post","/entity/socialmedia",params)
end

#postEntitySpecial_offer(entity_id, title, description, terms, start_date, expiry_date, url, image_url) ⇒ Object

With a known entity id, a website object can be added.

@param entity_id
@param title
@param description
@param terms
@param start_date
@param expiry_date
@param url
@param image_url
@return - the data from the api


1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
# File 'lib/CentralIndex.rb', line 1641

def postEntitySpecial_offer( entity_id, title, description, terms, start_date, expiry_date, url, image_url)
  params = Hash.new
  params['entity_id'] = entity_id
  params['title'] = title
  params['description'] = description
  params['terms'] = terms
  params['start_date'] = start_date
  params['expiry_date'] = expiry_date
  params['url'] = url
  params['image_url'] = image_url
  return doCurl("post","/entity/special_offer",params)
end

#postEntityStatus(entity_id, status) ⇒ Object

With a known entity id, a status object can be updated.

@param entity_id
@param status
@return - the data from the api


1662
1663
1664
1665
1666
1667
# File 'lib/CentralIndex.rb', line 1662

def postEntityStatus( entity_id, status)
  params = Hash.new
  params['entity_id'] = entity_id
  params['status'] = status
  return doCurl("post","/entity/status",params)
end

#postEntityTag(entity_id, tag, language) ⇒ Object

With a known entity id, an tag object can be added.

@param entity_id
@param tag
@param language
@return - the data from the api


1693
1694
1695
1696
1697
1698
1699
# File 'lib/CentralIndex.rb', line 1693

def postEntityTag( entity_id, tag, language)
  params = Hash.new
  params['entity_id'] = entity_id
  params['tag'] = tag
  params['language'] = language
  return doCurl("post","/entity/tag",params)
end

#postEntityTestimonial(entity_id, title, text, date, testifier_name) ⇒ Object

With a known entity id, a testimonial object can be added.

@param entity_id
@param title
@param text
@param date
@param testifier_name
@return - the data from the api


1712
1713
1714
1715
1716
1717
1718
1719
1720
# File 'lib/CentralIndex.rb', line 1712

def postEntityTestimonial( entity_id, title, text, date, testifier_name)
  params = Hash.new
  params['entity_id'] = entity_id
  params['title'] = title
  params['text'] = text
  params['date'] = date
  params['testifier_name'] = testifier_name
  return doCurl("post","/entity/testimonial",params)
end

#postEntityUnmerge(entity_id, supplier_masheryid, supplier_id) ⇒ Object

Separates an entity into two distinct entities

@param entity_id
@param supplier_masheryid
@param supplier_id
@return - the data from the api


1746
1747
1748
1749
1750
1751
1752
# File 'lib/CentralIndex.rb', line 1746

def postEntityUnmerge( entity_id, supplier_masheryid, supplier_id)
  params = Hash.new
  params['entity_id'] = entity_id
  params['supplier_masheryid'] = supplier_masheryid
  params['supplier_id'] = supplier_id
  return doCurl("post","/entity/unmerge",params)
end

#postEntityVideoYoutube(entity_id, embed_code) ⇒ Object

With a known entity id, a YouTube video object can be added.

@param entity_id
@param embed_code
@return - the data from the api


1777
1778
1779
1780
1781
1782
# File 'lib/CentralIndex.rb', line 1777

def postEntityVideoYoutube( entity_id, embed_code)
  params = Hash.new
  params['entity_id'] = entity_id
  params['embed_code'] = embed_code
  return doCurl("post","/entity/video/youtube",params)
end

#postEntityWebsite(entity_id, website_url, display_url, website_description) ⇒ Object

With a known entity id, a website object can be added.

@param entity_id
@param website_url
@param display_url
@param website_description
@return - the data from the api


1794
1795
1796
1797
1798
1799
1800
1801
# File 'lib/CentralIndex.rb', line 1794

def postEntityWebsite( entity_id, website_url, display_url, website_description)
  params = Hash.new
  params['entity_id'] = entity_id
  params['website_url'] = website_url
  params['display_url'] = display_url
  params['website_description'] = website_description
  return doCurl("post","/entity/website",params)
end

#postFlatpack(flatpack_id, domainName, flatpackName, less, language, country, mapsType, mapKey, searchFormShowOn, searchFormShowKeywordsBox, searchFormShowLocationBox, searchFormKeywordsAutoComplete, searchFormLocationsAutoComplete, searchFormDefaultLocation, searchFormPlaceholderKeywords, searchFormPlaceholderLocation, searchFormKeywordsLabel, searchFormLocationLabel, cannedLinksHeader, homepageTitle, homepageDescription, homepageIntroTitle, homepageIntroText, head, adblock, bodyTop, bodyBottom, header_menu, footer_menu, bdpTitle, bdpDescription, bdpAds, serpTitle, serpDescription, serpNumberResults, serpNumberAdverts, serpAds, cookiePolicyUrl, cookiePolicyNotice, addBusinessButtonText, twitterUrl, facebookUrl, copyright, advertUpgradeActive, advertUpgradePrice, advertUpgradeMaxTags, advertUpgradeMaxLocations, advertUpgradeContractLength, advertUpgradeRefId) ⇒ Object

Update/Add a flatpack

@param flatpack_id - this record's unique, auto-generated id - if supplied, then this is an edit, otherwise it's an add
@param domainName - the domain name to serve this flatpack site on (no leading http:// or anything please)
@param flatpackName - the name of the Flat pack instance
@param less - the LESS configuration to use to overrides the Bootstrap CSS
@param language - the language in which to render the flatpack site
@param country - the country to use for searches etc
@param mapsType - the type of maps to use
@param mapKey - the nokia map key to use to render maps
@param searchFormShowOn - list of pages to show the search form
@param searchFormShowKeywordsBox - whether to display the keywords box on the search form
@param searchFormShowLocationBox - whether to display the location box on search forms - not required
@param searchFormKeywordsAutoComplete - whether to do auto-completion on the keywords box on the search form
@param searchFormLocationsAutoComplete - whether to do auto-completion on the locations box on the search form
@param searchFormDefaultLocation - the string to use as the default location for searches if no location is supplied
@param searchFormPlaceholderKeywords - the string to show in the keyword box as placeholder text e.g. e.g. cafe
@param searchFormPlaceholderLocation - the string to show in the location box as placeholder text e.g. e.g. Dublin
@param searchFormKeywordsLabel - the string to show next to the keywords control e.g. I'm looking for
@param searchFormLocationLabel - the string to show next to the location control e.g. Located in
@param cannedLinksHeader - the string to show above canned searches
@param homepageTitle - the page title of site's home page
@param homepageDescription - the meta description of the home page
@param homepageIntroTitle - the introductory title for the homepage
@param homepageIntroText - the introductory text for the homepage
@param head - payload to put in the head of the flatpack
@param adblock - payload to put in the adblock of the flatpack
@param bodyTop - the payload to put in the top of the body of a flatpack
@param bodyBottom - the payload to put in the bottom of the body of a flatpack
@param header_menu - the JSON that describes a navigation at the top of the page
@param footer_menu - the JSON that describes a navigation at the bottom of the page
@param bdpTitle - The page title of the entity business profile pages
@param bdpDescription - The meta description of entity business profile pages
@param bdpAds - The block of HTML/JS that renders Ads on BDPs
@param serpTitle - The page title of the serps
@param serpDescription - The meta description of serps
@param serpNumberResults - The number of results per search page
@param serpNumberAdverts - The number of adverts to show on the first search page
@param serpAds - The block of HTML/JS that renders Ads on Serps
@param cookiePolicyUrl - The cookie policy url of the flatpack
@param cookiePolicyNotice - Whether to show the cookie policy on this flatpack
@param addBusinessButtonText - The text used in the 'Add your business' button
@param twitterUrl - Twitter link
@param facebookUrl - Facebook link
@param copyright - Copyright message
@param advertUpgradeActive - whether upgrade message is displayed on this Flatpack
@param advertUpgradePrice - the cost of upgrading
@param advertUpgradeMaxTags - the number of tags upgrading gives you
@param advertUpgradeMaxLocations - the number of locations upgrading gives you
@param advertUpgradeContractLength - the length of the contract (days)
@param advertUpgradeRefId - a unique reference for the upgrade
@return - the data from the api


1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
# File 'lib/CentralIndex.rb', line 1903

def postFlatpack( flatpack_id, domainName, flatpackName, less, language, country, mapsType, mapKey, searchFormShowOn, searchFormShowKeywordsBox, searchFormShowLocationBox, searchFormKeywordsAutoComplete, searchFormLocationsAutoComplete, searchFormDefaultLocation, searchFormPlaceholderKeywords, searchFormPlaceholderLocation, searchFormKeywordsLabel, searchFormLocationLabel, cannedLinksHeader, homepageTitle, homepageDescription, homepageIntroTitle, homepageIntroText, head, adblock, bodyTop, bodyBottom, header_menu, footer_menu, bdpTitle, bdpDescription, bdpAds, serpTitle, serpDescription, serpNumberResults, serpNumberAdverts, serpAds, cookiePolicyUrl, cookiePolicyNotice, addBusinessButtonText, twitterUrl, facebookUrl, copyright, advertUpgradeActive, advertUpgradePrice, advertUpgradeMaxTags, advertUpgradeMaxLocations, advertUpgradeContractLength, advertUpgradeRefId)
  params = Hash.new
  params['flatpack_id'] = flatpack_id
  params['domainName'] = domainName
  params['flatpackName'] = flatpackName
  params['less'] = less
  params['language'] = language
  params['country'] = country
  params['mapsType'] = mapsType
  params['mapKey'] = mapKey
  params['searchFormShowOn'] = searchFormShowOn
  params['searchFormShowKeywordsBox'] = searchFormShowKeywordsBox
  params['searchFormShowLocationBox'] = searchFormShowLocationBox
  params['searchFormKeywordsAutoComplete'] = searchFormKeywordsAutoComplete
  params['searchFormLocationsAutoComplete'] = searchFormLocationsAutoComplete
  params['searchFormDefaultLocation'] = searchFormDefaultLocation
  params['searchFormPlaceholderKeywords'] = searchFormPlaceholderKeywords
  params['searchFormPlaceholderLocation'] = searchFormPlaceholderLocation
  params['searchFormKeywordsLabel'] = searchFormKeywordsLabel
  params['searchFormLocationLabel'] = searchFormLocationLabel
  params['cannedLinksHeader'] = cannedLinksHeader
  params['homepageTitle'] = homepageTitle
  params['homepageDescription'] = homepageDescription
  params['homepageIntroTitle'] = homepageIntroTitle
  params['homepageIntroText'] = homepageIntroText
  params['head'] = head
  params['adblock'] = adblock
  params['bodyTop'] = bodyTop
  params['bodyBottom'] = bodyBottom
  params['header_menu'] = header_menu
  params['footer_menu'] = footer_menu
  params['bdpTitle'] = bdpTitle
  params['bdpDescription'] = bdpDescription
  params['bdpAds'] = bdpAds
  params['serpTitle'] = serpTitle
  params['serpDescription'] = serpDescription
  params['serpNumberResults'] = serpNumberResults
  params['serpNumberAdverts'] = serpNumberAdverts
  params['serpAds'] = serpAds
  params['cookiePolicyUrl'] = cookiePolicyUrl
  params['cookiePolicyNotice'] = cookiePolicyNotice
  params['addBusinessButtonText'] = addBusinessButtonText
  params['twitterUrl'] = twitterUrl
  params['facebookUrl'] = facebookUrl
  params['copyright'] = copyright
  params['advertUpgradeActive'] = advertUpgradeActive
  params['advertUpgradePrice'] = advertUpgradePrice
  params['advertUpgradeMaxTags'] = advertUpgradeMaxTags
  params['advertUpgradeMaxLocations'] = advertUpgradeMaxLocations
  params['advertUpgradeContractLength'] = advertUpgradeContractLength
  params['advertUpgradeRefId'] = advertUpgradeRefId
  return doCurl("post","/flatpack",params)
end

#postFlatpackIcon(flatpack_id, filedata) ⇒ Object

Upload an icon to serve out with this flatpack

@param flatpack_id - the id of the flatpack to update
@param filedata
@return - the data from the api


2002
2003
2004
2005
2006
2007
# File 'lib/CentralIndex.rb', line 2002

def postFlatpackIcon( flatpack_id, filedata)
  params = Hash.new
  params['flatpack_id'] = flatpack_id
  params['filedata'] = filedata
  return doCurl("post","/flatpack/icon",params)
end

Add a canned link to an existing flatpack site.

@param flatpack_id - the id of the flatpack to delete
@param keywords - the keywords to use in the canned search
@param location - the location to use in the canned search
@param linkText - the link text to be used to in the canned search link
@return - the data from the api


2034
2035
2036
2037
2038
2039
2040
2041
# File 'lib/CentralIndex.rb', line 2034

def postFlatpackLink( flatpack_id, keywords, location, linkText)
  params = Hash.new
  params['flatpack_id'] = flatpack_id
  params['keywords'] = keywords
  params['location'] = location
  params['linkText'] = linkText
  return doCurl("post","/flatpack/link",params)
end

#postFlatpackLogo(flatpack_id, filedata) ⇒ Object

Upload a logo to serve out with this flatpack

@param flatpack_id - the id of the flatpack to update
@param filedata
@return - the data from the api


2051
2052
2053
2054
2055
2056
# File 'lib/CentralIndex.rb', line 2051

def ( flatpack_id, filedata)
  params = Hash.new
  params['flatpack_id'] = flatpack_id
  params['filedata'] = filedata
  return doCurl("post","/flatpack/logo",params)
end

#postFlatpackUpload(filedata) ⇒ Object

Upload a file to our asset server and return the url

@param filedata
@return - the data from the api


2065
2066
2067
2068
2069
# File 'lib/CentralIndex.rb', line 2065

def postFlatpackUpload( filedata)
  params = Hash.new
  params['filedata'] = filedata
  return doCurl("post","/flatpack/upload",params)
end

#postGroup(group_id, name, description, url) ⇒ Object

Update/Add a Group

@param group_id
@param name
@param description
@param url
@return - the data from the api


2081
2082
2083
2084
2085
2086
2087
2088
# File 'lib/CentralIndex.rb', line 2081

def postGroup( group_id, name, description, url)
  params = Hash.new
  params['group_id'] = group_id
  params['name'] = name
  params['description'] = description
  params['url'] = url
  return doCurl("post","/group",params)
end

#postLocation(location_id, name, formal_name, latitude, longitude, resolution, country, population, description, timezone, is_duplicate, is_default, parent_town, parent_county, parent_province, parent_region, parent_neighbourhood, parent_district, postalcode) ⇒ Object

Create/update a new location entity with the supplied ID in the locations reference database.

@param location_id
@param name
@param formal_name
@param latitude
@param longitude
@param resolution
@param country
@param population
@param description
@param timezone
@param is_duplicate
@param is_default
@param parent_town
@param parent_county
@param parent_province
@param parent_region
@param parent_neighbourhood
@param parent_district
@param postalcode
@return - the data from the api


2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
# File 'lib/CentralIndex.rb', line 2154

def postLocation( location_id, name, formal_name, latitude, longitude, resolution, country, population, description, timezone, is_duplicate, is_default, parent_town, parent_county, parent_province, parent_region, parent_neighbourhood, parent_district, postalcode)
  params = Hash.new
  params['location_id'] = location_id
  params['name'] = name
  params['formal_name'] = formal_name
  params['latitude'] = latitude
  params['longitude'] = longitude
  params['resolution'] = resolution
  params['country'] = country
  params['population'] = population
  params['description'] = description
  params['timezone'] = timezone
  params['is_duplicate'] = is_duplicate
  params['is_default'] = is_default
  params['parent_town'] = parent_town
  params['parent_county'] = parent_county
  params['parent_province'] = parent_province
  params['parent_region'] = parent_region
  params['parent_neighbourhood'] = parent_neighbourhood
  params['parent_district'] = parent_district
  params['postalcode'] = postalcode
  return doCurl("post","/location",params)
end

#postLocationSource(location_id, type, url, ref) ⇒ Object

Add a new source to a known location

@param location_id
@param type
@param url
@param ref
@return - the data from the api


2201
2202
2203
2204
2205
2206
2207
2208
# File 'lib/CentralIndex.rb', line 2201

def postLocationSource( location_id, type, url, ref)
  params = Hash.new
  params['location_id'] = location_id
  params['type'] = type
  params['url'] = url
  params['ref'] = ref
  return doCurl("post","/location/source",params)
end

#postLocationSynonym(location_id, synonym, language) ⇒ Object

Add a new synonym to a known location

@param location_id
@param synonym
@param language
@return - the data from the api


2236
2237
2238
2239
2240
2241
2242
# File 'lib/CentralIndex.rb', line 2236

def postLocationSynonym( location_id, synonym, language)
  params = Hash.new
  params['location_id'] = location_id
  params['synonym'] = synonym
  params['language'] = language
  return doCurl("post","/location/synonym",params)
end

#postMessage(message_id, ses_id, from_user_id, from_email, to_entity_id, to_email, subject, body, bounced) ⇒ Object

Update/Add a message

@param message_id - Message id to pull
@param ses_id - Aamazon email id
@param from_user_id - User sending the message
@param from_email - Sent from email address
@param to_entity_id - The id of the entity being sent the message
@param to_email - Sent from email address
@param subject - Subject for the message
@param body - Body for the message
@param bounced - If the message bounced
@return - the data from the api


2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
# File 'lib/CentralIndex.rb', line 2410

def postMessage( message_id, ses_id, from_user_id, from_email, to_entity_id, to_email, subject, body, bounced)
  params = Hash.new
  params['message_id'] = message_id
  params['ses_id'] = ses_id
  params['from_user_id'] = from_user_id
  params['from_email'] = from_email
  params['to_entity_id'] = to_entity_id
  params['to_email'] = to_email
  params['subject'] = subject
  params['body'] = body
  params['bounced'] = bounced
  return doCurl("post","/message",params)
end

#postPublisher(publisher_id, country, name, description, active) ⇒ Object

Update/Add a publisher

@param publisher_id
@param country
@param name
@param description
@param active
@return - the data from the api


2528
2529
2530
2531
2532
2533
2534
2535
2536
# File 'lib/CentralIndex.rb', line 2528

def postPublisher( publisher_id, country, name, description, active)
  params = Hash.new
  params['publisher_id'] = publisher_id
  params['country'] = country
  params['name'] = name
  params['description'] = description
  params['active'] = active
  return doCurl("post","/publisher",params)
end

#postQueueError(queue_id, error) ⇒ Object

Add an error to a queue item

@param queue_id
@param error
@return - the data from the api


2615
2616
2617
2618
2619
2620
# File 'lib/CentralIndex.rb', line 2615

def postQueueError( queue_id, error)
  params = Hash.new
  params['queue_id'] = queue_id
  params['error'] = error
  return doCurl("post","/queue/error",params)
end

#postQueueUnlock(queue_name, seconds) ⇒ Object

Unlock queue items.

@param queue_name
@param seconds
@return - the data from the api


2645
2646
2647
2648
2649
2650
# File 'lib/CentralIndex.rb', line 2645

def postQueueUnlock( queue_name, seconds)
  params = Hash.new
  params['queue_name'] = queue_name
  params['seconds'] = seconds
  return doCurl("post","/queue/unlock",params)
end

#postSales_log(entity_id, action_type, publisher_id, mashery_id, reseller_ref, reseller_agent_id, max_tags, max_locations, extra_tags, extra_locations, expiry_date) ⇒ Object

Log a sale

@param entity_id - The entity the sale was made against
@param action_type - The type of action we are performing
@param publisher_id - The publisher id that has made the sale
@param mashery_id - The mashery id
@param reseller_ref - The reference of the sale made by the seller
@param reseller_agent_id - The id of the agent selling the product
@param max_tags - The number of tags available to the entity
@param max_locations - The number of locations available to the entity
@param extra_tags - The extra number of tags
@param extra_locations - The extra number of locations
@param expiry_date - The date the product expires
@return - the data from the api


2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
# File 'lib/CentralIndex.rb', line 2669

def postSales_log( entity_id, action_type, publisher_id, mashery_id, reseller_ref, reseller_agent_id, max_tags, max_locations, extra_tags, extra_locations, expiry_date)
  params = Hash.new
  params['entity_id'] = entity_id
  params['action_type'] = action_type
  params['publisher_id'] = publisher_id
  params['mashery_id'] = mashery_id
  params['reseller_ref'] = reseller_ref
  params['reseller_agent_id'] = reseller_agent_id
  params['max_tags'] = max_tags
  params['max_locations'] = max_locations
  params['extra_tags'] = extra_tags
  params['extra_locations'] = extra_locations
  params['expiry_date'] = expiry_date
  return doCurl("post","/sales_log",params)
end

#postSignal(entity_id, gen_id, signal_type, data_type) ⇒ Object

For insance, reporting a phone number as wrong

@param entity_id - A valid entity_id e.g. 379236608286720
@param gen_id - The gen_id for the item being reported
@param signal_type - The signal that is to be reported e.g. wrong
@param data_type - The type of data being reported
@return - the data from the api


2708
2709
2710
2711
2712
2713
2714
2715
# File 'lib/CentralIndex.rb', line 2708

def postSignal( entity_id, gen_id, signal_type, data_type)
  params = Hash.new
  params['entity_id'] = entity_id
  params['gen_id'] = gen_id
  params['signal_type'] = signal_type
  params['data_type'] = data_type
  return doCurl("post","/signal",params)
end

#postToolsGooglesheetAdd_row(spreadsheet_key, data) ⇒ Object

Given a spreadsheet id add a row

@param spreadsheet_key - The key of the spreadsheet to edit
@param data - A comma separated list to add as cells
@return - the data from the api


2952
2953
2954
2955
2956
2957
# File 'lib/CentralIndex.rb', line 2952

def postToolsGooglesheetAdd_row( spreadsheet_key, data)
  params = Hash.new
  params['spreadsheet_key'] = spreadsheet_key
  params['data'] = data
  return doCurl("post","/tools/googlesheet/add_row",params)
end

#postTraction(traction_id, trigger_type, action_type, country, email_addresses, title, body, api_method, api_url, api_params, active) ⇒ Object

Update/Add a traction

@param traction_id
@param trigger_type
@param action_type
@param country
@param email_addresses
@param title
@param body
@param api_method
@param api_url
@param api_params
@param active
@return - the data from the api


3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
# File 'lib/CentralIndex.rb', line 3191

def postTraction( traction_id, trigger_type, action_type, country, email_addresses, title, body, api_method, api_url, api_params, active)
  params = Hash.new
  params['traction_id'] = traction_id
  params['trigger_type'] = trigger_type
  params['action_type'] = action_type
  params['country'] = country
  params['email_addresses'] = email_addresses
  params['title'] = title
  params['body'] = body
  params['api_method'] = api_method
  params['api_url'] = api_url
  params['api_params'] = api_params
  params['active'] = active
  return doCurl("post","/traction",params)
end

#postTransactionAuthorised(transaction_id, paypal_getexpresscheckoutdetails) ⇒ Object

Set a transactions status to authorised

@param transaction_id
@param paypal_getexpresscheckoutdetails
@return - the data from the api


3262
3263
3264
3265
3266
3267
# File 'lib/CentralIndex.rb', line 3262

def postTransactionAuthorised( transaction_id, paypal_getexpresscheckoutdetails)
  params = Hash.new
  params['transaction_id'] = transaction_id
  params['paypal_getexpresscheckoutdetails'] = paypal_getexpresscheckoutdetails
  return doCurl("post","/transaction/authorised",params)
end

#postTransactionCancelled(transaction_id) ⇒ Object

Set a transactions status to cancelled

@param transaction_id
@return - the data from the api


3289
3290
3291
3292
3293
# File 'lib/CentralIndex.rb', line 3289

def postTransactionCancelled( transaction_id)
  params = Hash.new
  params['transaction_id'] = transaction_id
  return doCurl("post","/transaction/cancelled",params)
end

#postTransactionComplete(transaction_id, paypal_doexpresscheckoutpayment, user_id, entity_id) ⇒ Object

Set a transactions status to complete

@param transaction_id
@param paypal_doexpresscheckoutpayment
@param user_id
@param entity_id
@return - the data from the api


3305
3306
3307
3308
3309
3310
3311
3312
# File 'lib/CentralIndex.rb', line 3305

def postTransactionComplete( transaction_id, paypal_doexpresscheckoutpayment, user_id, entity_id)
  params = Hash.new
  params['transaction_id'] = transaction_id
  params['paypal_doexpresscheckoutpayment'] = paypal_doexpresscheckoutpayment
  params['user_id'] = user_id
  params['entity_id'] = entity_id
  return doCurl("post","/transaction/complete",params)
end

#postTransactionInprogress(transaction_id, paypal_setexpresscheckout) ⇒ Object

Set a transactions status to inprogess

@param transaction_id
@param paypal_setexpresscheckout
@return - the data from the api


3322
3323
3324
3325
3326
3327
# File 'lib/CentralIndex.rb', line 3322

def postTransactionInprogress( transaction_id, paypal_setexpresscheckout)
  params = Hash.new
  params['transaction_id'] = transaction_id
  params['paypal_setexpresscheckout'] = paypal_setexpresscheckout
  return doCurl("post","/transaction/inprogress",params)
end

#postUser(email, first_name, last_name, active, trust, creation_date, user_type, social_network, social_network_id, reseller_admin_masheryid) ⇒ Object

Update user based on email address or social_network/social_network_id

@param email
@param first_name
@param last_name
@param active
@param trust
@param creation_date
@param user_type
@param social_network
@param social_network_id
@param reseller_admin_masheryid
@return - the data from the api


3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
# File 'lib/CentralIndex.rb', line 3358

def postUser( email, first_name, last_name, active, trust, creation_date, user_type, social_network, social_network_id, reseller_admin_masheryid)
  params = Hash.new
  params['email'] = email
  params['first_name'] = first_name
  params['last_name'] = last_name
  params['active'] = active
  params['trust'] = trust
  params['creation_date'] = creation_date
  params['user_type'] = user_type
  params['social_network'] = social_network
  params['social_network_id'] = social_network_id
  params['reseller_admin_masheryid'] = reseller_admin_masheryid
  return doCurl("post","/user",params)
end

#postUserReseller_remove(user_id) ⇒ Object

Removes reseller privileges from a specified user

@param user_id
@return - the data from the api


3421
3422
3423
3424
3425
# File 'lib/CentralIndex.rb', line 3421

def postUserReseller_remove( user_id)
  params = Hash.new
  params['user_id'] = user_id
  return doCurl("post","/user/reseller_remove",params)
end

#putBusiness(name, building_number, address1, address2, address3, district, town, county, province, postcode, country, latitude, longitude, timezone, telephone_number, email, website, category_id, category_type, do_not_display) ⇒ Object

Create a new business entity with all it’s objects

@param name
@param building_number
@param address1
@param address2
@param address3
@param district
@param town
@param county
@param province
@param postcode
@param country
@param latitude
@param longitude
@param timezone
@param telephone_number
@param email
@param website
@param category_id
@param category_type
@param do_not_display
@return - the data from the api


162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/CentralIndex.rb', line 162

def putBusiness( name, building_number, address1, address2, address3, district, town, county, province, postcode, country, latitude, longitude, timezone, telephone_number, email, website, category_id, category_type, do_not_display)
  params = Hash.new
  params['name'] = name
  params['building_number'] = building_number
  params['address1'] = address1
  params['address2'] = address2
  params['address3'] = address3
  params['district'] = district
  params['town'] = town
  params['county'] = county
  params['province'] = province
  params['postcode'] = postcode
  params['country'] = country
  params['latitude'] = latitude
  params['longitude'] = longitude
  params['timezone'] = timezone
  params['telephone_number'] = telephone_number
  params['email'] = email
  params['website'] = website
  params['category_id'] = category_id
  params['category_type'] = category_type
  params['do_not_display'] = do_not_display
  return doCurl("put","/business",params)
end

#putCategory(category_id, language, name) ⇒ Object

With a known category id, an category object can be added.

@param category_id
@param language
@param name
@return - the data from the api


209
210
211
212
213
214
215
# File 'lib/CentralIndex.rb', line 209

def putCategory( category_id, language, name)
  params = Hash.new
  params['category_id'] = category_id
  params['language'] = language
  params['name'] = name
  return doCurl("put","/category",params)
end

#putEntity(type, scope, country, trust, our_data) ⇒ Object

This entity isn’t really supported anymore. You probably want PUT /business. Only to be used for testing.

@param type
@param scope
@param country
@param trust
@param our_data
@return - the data from the api


398
399
400
401
402
403
404
405
406
# File 'lib/CentralIndex.rb', line 398

def putEntity( type, scope, country, trust, our_data)
  params = Hash.new
  params['type'] = type
  params['scope'] = scope
  params['country'] = country
  params['trust'] = trust
  params['our_data'] = our_data
  return doCurl("put","/entity",params)
end

#putEntityserve(entity_id, country, event_type) ⇒ Object

Add an entityserve document

@param entity_id - The id of the entity to create the entityserve event for
@param country - the ISO code of the country
@param event_type - The event type being recorded
@return - the data from the api


1827
1828
1829
1830
1831
1832
1833
# File 'lib/CentralIndex.rb', line 1827

def putEntityserve( entity_id, country, event_type)
  params = Hash.new
  params['entity_id'] = entity_id
  params['country'] = country
  params['event_type'] = event_type
  return doCurl("put","/entityserve",params)
end

#putLogo(a) ⇒ Object

Fetch the project logo, the symbol of the Wolf

@param a
@return - the data from the api


2270
2271
2272
2273
2274
# File 'lib/CentralIndex.rb', line 2270

def ( a)
  params = Hash.new
  params['a'] = a
  return doCurl("put","/logo",params)
end

#putPrivate_object(entity_id, data) ⇒ Object

With a known entity id, a private object can be added.

@param entity_id - The entity to associate the private object with
@param data - The data to store
@return - the data from the api


2458
2459
2460
2461
2462
2463
# File 'lib/CentralIndex.rb', line 2458

def putPrivate_object( entity_id, data)
  params = Hash.new
  params['entity_id'] = entity_id
  params['data'] = data
  return doCurl("put","/private_object",params)
end

#putQueue(queue_name, data) ⇒ Object

Create a queue item

@param queue_name
@param data
@return - the data from the api


2600
2601
2602
2603
2604
2605
# File 'lib/CentralIndex.rb', line 2600

def putQueue( queue_name, data)
  params = Hash.new
  params['queue_name'] = queue_name
  params['data'] = data
  return doCurl("put","/queue",params)
end

#putTransaction(entity_id, user_id, basket_total, basket, currency, notes) ⇒ Object

Create a new transaction

@param entity_id
@param user_id
@param basket_total
@param basket
@param currency
@param notes
@return - the data from the api


3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
# File 'lib/CentralIndex.rb', line 3243

def putTransaction( entity_id, user_id, basket_total, basket, currency, notes)
  params = Hash.new
  params['entity_id'] = entity_id
  params['user_id'] = user_id
  params['basket_total'] = basket_total
  params['basket'] = basket
  params['currency'] = currency
  params['notes'] = notes
  return doCurl("put","/transaction",params)
end