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

#deleteBusiness_tool(tool_id) ⇒ Object

Delete a business tool with a specified tool_id

@param tool_id
@return - the data from the api


292
293
294
295
296
# File 'lib/CentralIndex.rb', line 292

def deleteBusiness_tool( tool_id)
  params = Hash.new
  params['tool_id'] = tool_id
  return doCurl("delete","/business_tool",params)
end

#deleteCategoryMappings(category_id, category_type, mapped_id) ⇒ Object

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

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


389
390
391
392
393
394
395
# File 'lib/CentralIndex.rb', line 389

def deleteCategoryMappings( category_id, category_type, mapped_id)
  params = Hash.new
  params['category_id'] = category_id
  params['category_type'] = category_type
  params['mapped_id'] = mapped_id
  return doCurl("delete","/category/mappings",params)
end

#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


440
441
442
443
444
445
446
# File 'lib/CentralIndex.rb', line 440

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


657
658
659
660
661
662
# File 'lib/CentralIndex.rb', line 657

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


837
838
839
840
841
842
# File 'lib/CentralIndex.rb', line 837

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


1006
1007
1008
1009
1010
1011
# File 'lib/CentralIndex.rb', line 1006

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


1059
1060
1061
1062
1063
1064
# File 'lib/CentralIndex.rb', line 1059

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


1091
1092
1093
1094
1095
1096
# File 'lib/CentralIndex.rb', line 1091

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


1123
1124
1125
1126
1127
1128
# File 'lib/CentralIndex.rb', line 1123

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


1155
1156
1157
1158
1159
1160
# File 'lib/CentralIndex.rb', line 1155

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


1214
1215
1216
1217
1218
1219
# File 'lib/CentralIndex.rb', line 1214

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


1248
1249
1250
1251
1252
1253
# File 'lib/CentralIndex.rb', line 1248

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


1278
1279
1280
1281
1282
1283
# File 'lib/CentralIndex.rb', line 1278

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


1342
1343
1344
1345
1346
# File 'lib/CentralIndex.rb', line 1342

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


1373
1374
1375
1376
1377
1378
# File 'lib/CentralIndex.rb', line 1373

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


1388
1389
1390
1391
1392
1393
# File 'lib/CentralIndex.rb', line 1388

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

#deleteEntityOpening_times(entity_id) ⇒ Object

With a known entity id, a opening times object can be removed.

@param entity_id - The id of the entity to edit
@return - the data from the api


1507
1508
1509
1510
1511
# File 'lib/CentralIndex.rb', line 1507

def deleteEntityOpening_times( entity_id)
  params = Hash.new
  params['entity_id'] = entity_id
  return doCurl("delete","/entity/opening_times",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


1538
1539
1540
1541
1542
1543
# File 'lib/CentralIndex.rb', line 1538

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


1856
1857
1858
1859
1860
1861
# File 'lib/CentralIndex.rb', line 1856

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


1915
1916
1917
1918
1919
1920
# File 'lib/CentralIndex.rb', line 1915

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


1949
1950
1951
1952
1953
1954
# File 'lib/CentralIndex.rb', line 1949

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


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

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


2053
2054
2055
2056
2057
2058
# File 'lib/CentralIndex.rb', line 2053

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


2102
2103
2104
2105
2106
2107
# File 'lib/CentralIndex.rb', line 2102

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


2146
2147
2148
2149
2150
# File 'lib/CentralIndex.rb', line 2146

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


2386
2387
2388
2389
2390
2391
# File 'lib/CentralIndex.rb', line 2386

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


2494
2495
2496
2497
2498
# File 'lib/CentralIndex.rb', line 2494

def deleteGroup( group_id)
  params = Hash.new
  params['group_id'] = group_id
  return doCurl("delete","/group",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


2896
2897
2898
2899
2900
# File 'lib/CentralIndex.rb', line 2896

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


3024
3025
3026
3027
3028
# File 'lib/CentralIndex.rb', line 3024

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


3097
3098
3099
3100
3101
# File 'lib/CentralIndex.rb', line 3097

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


3906
3907
3908
3909
3910
# File 'lib/CentralIndex.rb', line 3906

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

#getActivity_stream(type, country, latitude_1, longitude_1, latitude_2, longitude_2, number_results) ⇒ Object

Get the activity from the collection

@param type - The activity type
@param country - The country to filter by
@param latitude_1 - The latitude_1 to filter by
@param longitude_1 - The longitude_1 to filter by
@param latitude_2 - The latitude_2 to filter by
@param longitude_2 - The longitude_2 to filter by
@param number_results - The number_results to filter by
@return - the data from the api


74
75
76
77
78
79
80
81
82
83
84
# File 'lib/CentralIndex.rb', line 74

def getActivity_stream( type, country, latitude_1, longitude_1, latitude_2, longitude_2, number_results)
  params = Hash.new
  params['type'] = type
  params['country'] = country
  params['latitude_1'] = latitude_1
  params['longitude_1'] = longitude_1
  params['latitude_2'] = latitude_2
  params['longitude_2'] = longitude_2
  params['number_results'] = number_results
  return doCurl("get","/activity_stream",params)
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


117
118
119
120
121
122
# File 'lib/CentralIndex.rb', line 117

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

#getAdvertiserUpdatedBy_publisher(publisher_id, from_date, country) ⇒ Object

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

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


133
134
135
136
137
138
139
# File 'lib/CentralIndex.rb', line 133

def getAdvertiserUpdatedBy_publisher( publisher_id, from_date, country)
  params = Hash.new
  params['publisher_id'] = publisher_id
  params['from_date'] = from_date
  params['country'] = country
  return doCurl("get","/advertiser/updated/by_publisher",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


149
150
151
152
153
154
# File 'lib/CentralIndex.rb', line 149

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


164
165
166
167
168
169
# File 'lib/CentralIndex.rb', line 164

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

#getAutocompleteLocation(str, country, language) ⇒ 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
@param language - An ISO compatible language code, E.g. en e.g. en
@return - the data from the api


180
181
182
183
184
185
186
# File 'lib/CentralIndex.rb', line 180

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

#getAutocompleteLocationBy_resolution(str, country, resolution) ⇒ Object

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

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


197
198
199
200
201
202
203
# File 'lib/CentralIndex.rb', line 197

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

#getBusiness_tool(tool_id) ⇒ Object

Returns business tool that matches a given tool id

@param tool_id
@return - the data from the api


305
306
307
308
309
# File 'lib/CentralIndex.rb', line 305

def getBusiness_tool( tool_id)
  params = Hash.new
  params['tool_id'] = tool_id
  return doCurl("get","/business_tool",params)
end

#getBusiness_toolBy_masheryid(country) ⇒ Object

Returns active business tools for a specific masheryid in a given country

@param country
@return - the data from the api


318
319
320
321
322
# File 'lib/CentralIndex.rb', line 318

def getBusiness_toolBy_masheryid( country)
  params = Hash.new
  params['country'] = country
  return doCurl("get","/business_tool/by_masheryid",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


363
364
365
366
367
# File 'lib/CentralIndex.rb', line 363

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


375
376
377
378
# File 'lib/CentralIndex.rb', line 375

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


537
538
539
540
541
# File 'lib/CentralIndex.rb', line 537

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


605
606
607
608
609
# File 'lib/CentralIndex.rb', line 605

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


819
820
821
822
823
824
825
826
827
# File 'lib/CentralIndex.rb', line 819

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


910
911
912
913
914
# File 'lib/CentralIndex.rb', line 910

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


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

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

#getEntityBy_groupid(group_id) ⇒ Object

Get all entities within a specified group

@param group_id
@return - the data from the api


949
950
951
952
953
# File 'lib/CentralIndex.rb', line 949

def getEntityBy_groupid( group_id)
  params = Hash.new
  params['group_id'] = group_id
  return doCurl("get","/entity/by_groupid",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


962
963
964
965
966
# File 'lib/CentralIndex.rb', line 962

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


975
976
977
978
979
# File 'lib/CentralIndex.rb', line 975

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


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

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

#getEntityProvisionalBy_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


1587
1588
1589
1590
1591
# File 'lib/CentralIndex.rb', line 1587

def getEntityProvisionalBy_supplier_id( supplier_id)
  params = Hash.new
  params['supplier_id'] = supplier_id
  return doCurl("get","/entity/provisional/by_supplier_id",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


1600
1601
1602
1603
1604
# File 'lib/CentralIndex.rb', line 1600

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


1614
1615
1616
1617
1618
1619
# File 'lib/CentralIndex.rb', line 1614

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

#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


1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
# File 'lib/CentralIndex.rb', line 1635

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, latitude, longitude) ⇒ 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
@param latitude - The decimal latitude of the search context (optional)
@param longitude - The decimal longitude of the search context (optional)
@return - the data from the api


1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
# File 'lib/CentralIndex.rb', line 1661

def getEntitySearchBylocation( where, per_page, page, country, language, latitude, longitude)
  params = Hash.new
  params['where'] = where
  params['per_page'] = per_page
  params['page'] = page
  params['country'] = country
  params['language'] = language
  params['latitude'] = latitude
  params['longitude'] = longitude
  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


1684
1685
1686
1687
1688
1689
1690
1691
1692
# File 'lib/CentralIndex.rb', line 1684

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


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

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, latitude, longitude) ⇒ 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
@param latitude - The decimal latitude of the search context (optional)
@param longitude - The decimal longitude of the search context (optional)
@return - the data from the api


1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
# File 'lib/CentralIndex.rb', line 1737

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

#getEntitySearchWho(who, per_page, page, country, language) ⇒ 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
@param language - An ISO compatible language code, E.g. en
@return - the data from the api


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

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

#getEntitySearchWhoByboundingbox(who, latitude_1, longitude_1, latitude_2, longitude_2, per_page, page, country, language) ⇒ 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
@param language - An ISO compatible language code, E.g. en
@return - the data from the api


1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
# File 'lib/CentralIndex.rb', line 1786

def getEntitySearchWhoByboundingbox( who, latitude_1, longitude_1, latitude_2, longitude_2, per_page, page, country, language)
  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
  params['language'] = language
  return doCurl("get","/entity/search/who/byboundingbox",params)
end

#getEntitySearchWhoBylocation(who, where, per_page, page, country, latitude, longitude, language) ⇒ 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
@param latitude - The decimal latitude of the search context (optional)
@param longitude - The decimal longitude of the search context (optional)
@param language - An ISO compatible language code, E.g. en
@return - the data from the api


1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
# File 'lib/CentralIndex.rb', line 1814

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

#getEntityUncontribute(entity_id, object_name, supplier_id, user_id) ⇒ Object

Get the updates a uncontribute would perform

@param entity_id - The entity to pull
@param object_name - The entity object to update
@param supplier_id - The supplier_id to remove
@param user_id - The user_id to remove
@return - the data from the api


2019
2020
2021
2022
2023
2024
2025
2026
# File 'lib/CentralIndex.rb', line 2019

def getEntityUncontribute( entity_id, object_name, supplier_id, user_id)
  params = Hash.new
  params['entity_id'] = entity_id
  params['object_name'] = object_name
  params['supplier_id'] = supplier_id
  params['user_id'] = user_id
  return doCurl("get","/entity/uncontribute",params)
end

#getFlatpack(flatpack_id) ⇒ Object

Get a flatpack

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


2133
2134
2135
2136
2137
# File 'lib/CentralIndex.rb', line 2133

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


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

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


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

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

#getFlatpackClone(flatpack_id, domainName) ⇒ Object

Clone an existing flatpack

@param flatpack_id - the flatpack_id to clone
@param domainName - the domain of the new flatpack site (no leading http:// or anything please)
@return - the data from the api


2356
2357
2358
2359
2360
2361
# File 'lib/CentralIndex.rb', line 2356

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

#getGroup(group_id) ⇒ Object

Returns group that matches a given group id

@param group_id
@return - the data from the api


2462
2463
2464
2465
2466
# File 'lib/CentralIndex.rb', line 2462

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

#getHeartbeatBy_date(from_date, to_date, country_id) ⇒ Object

Get number of claims today

@param from_date
@param to_date
@param country_id
@return - the data from the api


2524
2525
2526
2527
2528
2529
2530
# File 'lib/CentralIndex.rb', line 2524

def getHeartbeatBy_date( from_date, to_date, country_id)
  params = Hash.new
  params['from_date'] = from_date
  params['to_date'] = to_date
  params['country_id'] = country_id
  return doCurl("get","/heartbeat/by_date",params)
end

#getHeartbeatTodayClaims(country, claim_type) ⇒ Object

Get number of claims today

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


2540
2541
2542
2543
2544
2545
# File 'lib/CentralIndex.rb', line 2540

def getHeartbeatTodayClaims( country, claim_type)
  params = Hash.new
  params['country'] = country
  params['claim_type'] = claim_type
  return doCurl("get","/heartbeat/today/claims",params)
end

#getIngest_job(job_id) ⇒ Object

Get an ingest job from the collection

@param job_id
@return - the data from the api


2584
2585
2586
2587
2588
# File 'lib/CentralIndex.rb', line 2584

def getIngest_job( job_id)
  params = Hash.new
  params['job_id'] = job_id
  return doCurl("get","/ingest_job",params)
end

#getIngest_logBy_job_id(job_id, success, errors, limit, skip) ⇒ Object

Get an ingest log from the collection

@param job_id
@param success
@param errors
@param limit
@param skip
@return - the data from the api


2601
2602
2603
2604
2605
2606
2607
2608
2609
# File 'lib/CentralIndex.rb', line 2601

def getIngest_logBy_job_id( job_id, success, errors, limit, skip)
  params = Hash.new
  params['job_id'] = job_id
  params['success'] = success
  params['errors'] = errors
  params['limit'] = limit
  params['skip'] = skip
  return doCurl("get","/ingest_log/by_job_id",params)
end

#getIngest_queue(flush) ⇒ Object

Check the status of the Ingest queue, and potentially flush it

@param flush
@return - the data from the api


2618
2619
2620
2621
2622
# File 'lib/CentralIndex.rb', line 2618

def getIngest_queue( flush)
  params = Hash.new
  params['flush'] = flush
  return doCurl("get","/ingest_queue",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


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

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


2697
2698
2699
2700
2701
# File 'lib/CentralIndex.rb', line 2697

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


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

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


2743
2744
2745
2746
2747
2748
# File 'lib/CentralIndex.rb', line 2743

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


2758
2759
2760
2761
2762
2763
# File 'lib/CentralIndex.rb', line 2758

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

#getLookupLocation(string, language, country, latitude, longitude) ⇒ Object

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

@param string
@param language
@param country
@param latitude
@param longitude
@return - the data from the api


2776
2777
2778
2779
2780
2781
2782
2783
2784
# File 'lib/CentralIndex.rb', line 2776

def getLookupLocation( string, language, country, latitude, longitude)
  params = Hash.new
  params['string'] = string
  params['language'] = language
  params['country'] = country
  params['latitude'] = latitude
  params['longitude'] = longitude
  return doCurl("get","/lookup/location",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


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

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, postcode, 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 postcode
@param country
@param name_strictness
@param location_strictness
@return - the data from the api


2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
# File 'lib/CentralIndex.rb', line 2821

def getMatchByphone( phone, company_name, latitude, longitude, postcode, country, name_strictness, location_strictness)
  params = Hash.new
  params['phone'] = phone
  params['company_name'] = company_name
  params['latitude'] = latitude
  params['longitude'] = longitude
  params['postcode'] = postcode
  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


2841
2842
2843
2844
2845
# File 'lib/CentralIndex.rb', line 2841

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


2883
2884
2885
2886
2887
# File 'lib/CentralIndex.rb', line 2883

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


2924
2925
2926
2927
2928
# File 'lib/CentralIndex.rb', line 2924

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

#getPtbAll(entity_id, destructive) ⇒ Object

Perform the whole PTB process on the supplied entity

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


2938
2939
2940
2941
2942
2943
# File 'lib/CentralIndex.rb', line 2938

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

#getPtbLog(year, month, entity_id) ⇒ Object

Report on what happened to specific entity_id

@param year - the year to examine
@param month - the month to examine
@param entity_id - the entity to research
@return - the data from the api


2954
2955
2956
2957
2958
2959
2960
# File 'lib/CentralIndex.rb', line 2954

def getPtbLog( year, month, entity_id)
  params = Hash.new
  params['year'] = year
  params['month'] = month
  params['entity_id'] = entity_id
  return doCurl("get","/ptb/log",params)
end

#getPtbModule(entity_id, __module, destructive) ⇒ Object

Process an entity with a specific PTB module

@param entity_id
@param module
@param destructive
@return - the data from the api


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

def getPtbModule( entity_id, __module, destructive)
  params = Hash.new
  params['entity_id'] = entity_id
  params['module'] = __module
  params['destructive'] = destructive
  return doCurl("get","/ptb/module",params)
end

#getPtbRunrate(country, year, month, day) ⇒ Object

Report on the run-rate of the Paint the Bridge System

@param country - the country to get the runrate for
@param year - the year to examine
@param month - the month to examine
@param day - the day to examine
@return - the data from the api


2989
2990
2991
2992
2993
2994
2995
2996
# File 'lib/CentralIndex.rb', line 2989

def getPtbRunrate( country, year, month, day)
  params = Hash.new
  params['country'] = country
  params['year'] = year
  params['month'] = month
  params['day'] = day
  return doCurl("get","/ptb/runrate",params)
end

#getPtbValueadded(country, year, month, day) ⇒ Object

Report on the value being added by Paint The Bridge

@param country - the country to get the runrate for
@param year - the year to examine
@param month - the month to examine
@param day - the day to examine
@return - the data from the api


3008
3009
3010
3011
3012
3013
3014
3015
# File 'lib/CentralIndex.rb', line 3008

def getPtbValueadded( country, year, month, day)
  params = Hash.new
  params['country'] = country
  params['year'] = year
  params['month'] = month
  params['day'] = day
  return doCurl("get","/ptb/valueadded",params)
end

#getPublisher(publisher_id) ⇒ Object

Returns publisher that matches a given publisher id

@param publisher_id
@return - the data from the api


3037
3038
3039
3040
3041
# File 'lib/CentralIndex.rb', line 3037

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


3071
3072
3073
3074
3075
# File 'lib/CentralIndex.rb', line 3071

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


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

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


3111
3112
3113
3114
3115
3116
# File 'lib/CentralIndex.rb', line 3111

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


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

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


3185
3186
3187
3188
3189
# File 'lib/CentralIndex.rb', line 3185

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

#getSales_logBy_countryBy_date(from_date, country, action_type) ⇒ Object

Return a sales log by id

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


3200
3201
3202
3203
3204
3205
3206
# File 'lib/CentralIndex.rb', line 3200

def getSales_logBy_countryBy_date( from_date, country, action_type)
  params = Hash.new
  params['from_date'] = from_date
  params['country'] = country
  params['action_type'] = action_type
  return doCurl("get","/sales_log/by_country/by_date",params)
end

#getSales_logBy_date(from_date, to_date) ⇒ Object

Return a sales log by id

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


3216
3217
3218
3219
3220
3221
# File 'lib/CentralIndex.rb', line 3216

def getSales_logBy_date( from_date, to_date)
  params = Hash.new
  params['from_date'] = from_date
  params['to_date'] = to_date
  return doCurl("get","/sales_log/by_date",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


3319
3320
3321
3322
3323
3324
3325
# File 'lib/CentralIndex.rb', line 3319

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

#getStatsEntityBy_year(entity_id, year) ⇒ Object

Get the stats on an entity in a given year

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


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

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

#getStatusObject

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

@return - the data from the api


3348
3349
3350
3351
# File 'lib/CentralIndex.rb', line 3348

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

#getTokenAdd(language, portal_name, country, flatpack_id) ⇒ 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
@param flatpack_id - The id of the flatpack site where the request originated
@return - the data from the api


3415
3416
3417
3418
3419
3420
3421
3422
# File 'lib/CentralIndex.rb', line 3415

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

#getTokenClaim(entity_id, language, portal_name, flatpack_id) ⇒ 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
@param flatpack_id - The id of the flatpack site where the request originated
@return - the data from the api


3434
3435
3436
3437
3438
3439
3440
3441
# File 'lib/CentralIndex.rb', line 3434

def getTokenClaim( entity_id, language, portal_name, flatpack_id)
  params = Hash.new
  params['entity_id'] = entity_id
  params['language'] = language
  params['portal_name'] = portal_name
  params['flatpack_id'] = flatpack_id
  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


3450
3451
3452
3453
3454
# File 'lib/CentralIndex.rb', line 3450

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

#getTokenEdit(entity_id, language, flatpack_id, edit_page) ⇒ Object

Fetch token for edit path

@param entity_id - The id of the entity being upgraded
@param language - The language for the app
@param flatpack_id - The id of the flatpack site where the request originated
@param edit_page - the page in the edit path that the user should land on
@return - the data from the api


3466
3467
3468
3469
3470
3471
3472
3473
# File 'lib/CentralIndex.rb', line 3466

def getTokenEdit( entity_id, language, flatpack_id, edit_page)
  params = Hash.new
  params['entity_id'] = entity_id
  params['language'] = language
  params['flatpack_id'] = flatpack_id
  params['edit_page'] = edit_page
  return doCurl("get","/token/edit",params)
end

#getTokenLogin(portal_name, language, flatpack_id) ⇒ Object

Fetch token for login path

@param portal_name - The name of the application that has initiated the login process, example: 'Your Local'
@param language - The language for the app
@param flatpack_id - The id of the flatpack site where the request originated
@return - the data from the api


3484
3485
3486
3487
3488
3489
3490
# File 'lib/CentralIndex.rb', line 3484

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

#getTokenMessage(entity_id, portal_name, language, flatpack_id) ⇒ 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
@param flatpack_id - The id of the flatpack site where the request originated
@return - the data from the api


3502
3503
3504
3505
3506
3507
3508
3509
# File 'lib/CentralIndex.rb', line 3502

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

#getTokenReport(entity_id, portal_name, language, flatpack_id) ⇒ 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
@param flatpack_id - The id of the flatpack site where the request originated
@return - the data from the api


3521
3522
3523
3524
3525
3526
3527
3528
# File 'lib/CentralIndex.rb', line 3521

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

#getTokenUpgrade(entity_id, portal_name, language, price, max_tags, max_locations, contract_length, ref_id, flatpack_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 login 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
@param flatpack_id - The id of the flatpack site where the request originated
@return - the data from the api


3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
# File 'lib/CentralIndex.rb', line 3545

def getTokenUpgrade( entity_id, portal_name, language, price, max_tags, max_locations, contract_length, ref_id, flatpack_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
  params['flatpack_id'] = flatpack_id
  return doCurl("get","/token/upgrade",params)
end

#getToolsAddressdiff(first_entity_id, second_entity_id) ⇒ Object

The JaroWinklerDistance between two entities postal address objects

@param first_entity_id - The entity id of the first entity to be used in the postal address difference
@param second_entity_id - The entity id of the second entity to be used in the postal address difference
@return - the data from the api


3567
3568
3569
3570
3571
3572
# File 'lib/CentralIndex.rb', line 3567

def getToolsAddressdiff( first_entity_id, second_entity_id)
  params = Hash.new
  params['first_entity_id'] = first_entity_id
  params['second_entity_id'] = second_entity_id
  return doCurl("get","/tools/addressdiff",params)
end

#getToolsAddressdiff2(first_entity_id, second_entity_id) ⇒ Object

The JaroWinklerDistance between two entities postal address objects

@param first_entity_id - The entity id of the first entity to be used in the postal address difference
@param second_entity_id - The entity id of the second entity to be used in the postal address difference
@return - the data from the api


3582
3583
3584
3585
3586
3587
# File 'lib/CentralIndex.rb', line 3582

def getToolsAddressdiff2( first_entity_id, second_entity_id)
  params = Hash.new
  params['first_entity_id'] = first_entity_id
  params['second_entity_id'] = second_entity_id
  return doCurl("get","/tools/addressdiff2",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


3597
3598
3599
3600
3601
3602
# File 'lib/CentralIndex.rb', line 3597

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


3612
3613
3614
3615
3616
3617
# File 'lib/CentralIndex.rb', line 3612

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


3627
3628
3629
3630
3631
3632
# File 'lib/CentralIndex.rb', line 3627

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


3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
# File 'lib/CentralIndex.rb', line 3650

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


3705
3706
3707
3708
3709
3710
3711
3712
# File 'lib/CentralIndex.rb', line 3705

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


3721
3722
3723
3724
3725
# File 'lib/CentralIndex.rb', line 3721

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

#getToolsPhonecallVerify(to, from, pin, twilio_voice) ⇒ 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 twilio_voice - The language to read the verification in
@return - the data from the api


3737
3738
3739
3740
3741
3742
3743
3744
# File 'lib/CentralIndex.rb', line 3737

def getToolsPhonecallVerify( to, from, pin, twilio_voice)
  params = Hash.new
  params['to'] = to
  params['from'] = from
  params['pin'] = pin
  params['twilio_voice'] = twilio_voice
  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


3753
3754
3755
3756
3757
# File 'lib/CentralIndex.rb', line 3753

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


3766
3767
3768
3769
3770
# File 'lib/CentralIndex.rb', line 3766

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


3779
3780
3781
3782
3783
# File 'lib/CentralIndex.rb', line 3779

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


3791
3792
3793
3794
# File 'lib/CentralIndex.rb', line 3791

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


3804
3805
3806
3807
3808
3809
# File 'lib/CentralIndex.rb', line 3804

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


3820
3821
3822
3823
3824
3825
3826
# File 'lib/CentralIndex.rb', line 3820

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


3837
3838
3839
3840
3841
3842
3843
# File 'lib/CentralIndex.rb', line 3837

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


3852
3853
3854
3855
3856
# File 'lib/CentralIndex.rb', line 3852

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


3865
3866
3867
3868
3869
# File 'lib/CentralIndex.rb', line 3865

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


3878
3879
3880
3881
3882
# File 'lib/CentralIndex.rb', line 3878

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

#getToolsValidate_phone(phone_number, country) ⇒ Object

Calls a number to make sure it is active

@param phone_number - The phone number to validate
@param country - The country code of the phone number to be validated
@return - the data from the api


3892
3893
3894
3895
3896
3897
# File 'lib/CentralIndex.rb', line 3892

def getToolsValidate_phone( phone_number, country)
  params = Hash.new
  params['phone_number'] = phone_number
  params['country'] = country
  return doCurl("get","/tools/validate_phone",params)
end

#getTraction(traction_id) ⇒ Object

Fetching a traction

@param traction_id
@return - the data from the api


3958
3959
3960
3961
3962
# File 'lib/CentralIndex.rb', line 3958

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


3970
3971
3972
3973
# File 'lib/CentralIndex.rb', line 3970

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


4005
4006
4007
4008
4009
# File 'lib/CentralIndex.rb', line 4005

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


4033
4034
4035
4036
4037
# File 'lib/CentralIndex.rb', line 4033

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


4130
4131
4132
4133
4134
# File 'lib/CentralIndex.rb', line 4130

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


4143
4144
4145
4146
4147
# File 'lib/CentralIndex.rb', line 4143

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

#getUserBy_groupid(group_id) ⇒ Object

Returns all the users that match the supplied group_id

@param group_id
@return - the data from the api


4156
4157
4158
4159
4160
# File 'lib/CentralIndex.rb', line 4156

def getUserBy_groupid( group_id)
  params = Hash.new
  params['group_id'] = group_id
  return doCurl("get","/user/by_groupid",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


4169
4170
4171
4172
4173
# File 'lib/CentralIndex.rb', line 4169

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


4183
4184
4185
4186
4187
4188
# File 'lib/CentralIndex.rb', line 4183

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

#getViewhelper(database, designdoc, view, doc) ⇒ Object

Shows what would be emitted by a view, given a document

@param database - the database being worked on e.g. entities
@param designdoc - the design document containing the view e.g. _design/report
@param view - the name of the view to be tested e.g. bydate
@param doc - the JSON document to be analysed e.g. {}
@return - the data from the api


4226
4227
4228
4229
4230
4231
4232
4233
# File 'lib/CentralIndex.rb', line 4226

def getViewhelper( database, designdoc, view, doc)
  params = Hash.new
  params['database'] = database
  params['designdoc'] = designdoc
  params['view'] = view
  params['doc'] = doc
  return doCurl("get","/viewhelper",params)
end

#postActivity_stream(entity_id, entity_name, type, country, longitude, latitude) ⇒ Object

When we get some activity make a record of it

@param entity_id - The entity to pull
@param entity_name - The entity name this entry refers to
@param type - The activity type
@param country - The country for the activity
@param longitude - The longitude for teh activity
@param latitude - The latitude for teh activity
@return - the data from the api


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

def postActivity_stream( entity_id, entity_name, type, country, longitude, latitude)
  params = Hash.new
  params['entity_id'] = entity_id
  params['entity_name'] = entity_name
  params['type'] = type
  params['country'] = country
  params['longitude'] = longitude
  params['latitude'] = latitude
  return doCurl("post","/activity_stream",params)
end

#postBusiness_tool(tool_id, country, headline, description, link_url, active) ⇒ Object

Update/Add a Business Tool

@param tool_id
@param country
@param headline
@param description
@param link_url
@param active
@return - the data from the api


274
275
276
277
278
279
280
281
282
283
# File 'lib/CentralIndex.rb', line 274

def postBusiness_tool( tool_id, country, headline, description, link_url, active)
  params = Hash.new
  params['tool_id'] = tool_id
  params['country'] = country
  params['headline'] = headline
  params['description'] = description
  params['link_url'] = link_url
  params['active'] = active
  return doCurl("post","/business_tool",params)
end

#postBusiness_toolImage(tool_id, filedata) ⇒ Object

Assigns a Business Tool image

@param tool_id
@param filedata
@return - the data from the api


332
333
334
335
336
337
# File 'lib/CentralIndex.rb', line 332

def postBusiness_toolImage( tool_id, filedata)
  params = Hash.new
  params['tool_id'] = tool_id
  params['filedata'] = filedata
  return doCurl("post","/business_tool/image",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


407
408
409
410
411
412
413
414
# File 'lib/CentralIndex.rb', line 407

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


424
425
426
427
428
429
# File 'lib/CentralIndex.rb', line 424

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


457
458
459
460
461
462
463
# File 'lib/CentralIndex.rb', line 457

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, twilio_voice, currency_symbol, currency_symbol_html, postcodeLookupActive, addressFields) ⇒ 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
@param twilio_voice
@param currency_symbol - the symbol of this country's currency
@param currency_symbol_html - the html version of the symbol of this country's currency
@param postcodeLookupActive - Whether the lookup is activated for this country
@param addressFields - Whether fields are activated for this country
@return - the data from the api


498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
# File 'lib/CentralIndex.rb', line 498

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, twilio_voice, currency_symbol, currency_symbol_html, postcodeLookupActive, addressFields)
  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
  params['twilio_voice'] = twilio_voice
  params['currency_symbol'] = currency_symbol
  params['currency_symbol_html'] = currency_symbol_html
  params['postcodeLookupActive'] = postcodeLookupActive
  params['addressFields'] = addressFields
  return doCurl("post","/country",params)
end

#postCountryBackgroundImage(country_id, filedata, backgroundImageAttr) ⇒ Object

For a given country add/update a background image to show in the add/edit path

@param country_id
@param filedata
@param backgroundImageAttr
@return - the data from the api


552
553
554
555
556
557
558
# File 'lib/CentralIndex.rb', line 552

def postCountryBackgroundImage( country_id, filedata, backgroundImageAttr)
  params = Hash.new
  params['country_id'] = country_id
  params['filedata'] = filedata
  params['backgroundImageAttr'] = backgroundImageAttr
  return doCurl("post","/country/backgroundImage",params)
end

#postCountrySocialLoginImage(country_id, filedata) ⇒ Object

For a given country add/update a social login background image to show in the add/edit path

@param country_id
@param filedata
@return - the data from the api


568
569
570
571
572
573
# File 'lib/CentralIndex.rb', line 568

def postCountrySocialLoginImage( country_id, filedata)
  params = Hash.new
  params['country_id'] = country_id
  params['filedata'] = filedata
  return doCurl("post","/country/socialLoginImage",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 source_account - The source account 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


587
588
589
590
591
592
593
594
595
596
# File 'lib/CentralIndex.rb', line 587

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

#postEntityAdd(entity_id, add_referrer_url, add_referrer_name) ⇒ Object

With a known entity id, an add can be updated.

@param entity_id
@param add_referrer_url
@param add_referrer_name
@return - the data from the api


641
642
643
644
645
646
647
# File 'lib/CentralIndex.rb', line 641

def postEntityAdd( entity_id, add_referrer_url, add_referrer_name)
  params = Hash.new
  params['entity_id'] = entity_id
  params['add_referrer_url'] = add_referrer_url
  params['add_referrer_name'] = add_referrer_name
  return doCurl("post","/entity/add",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


674
675
676
677
678
679
680
681
# File 'lib/CentralIndex.rb', line 674

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


700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
# File 'lib/CentralIndex.rb', line 700

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


726
727
728
729
730
731
732
733
# File 'lib/CentralIndex.rb', line 726

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


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

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


767
768
769
770
771
772
773
774
775
# File 'lib/CentralIndex.rb', line 767

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


793
794
795
796
797
798
799
800
801
802
803
804
805
806
# File 'lib/CentralIndex.rb', line 793

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 affiliate_logo
@return - the data from the api


855
856
857
858
859
860
861
862
863
# File 'lib/CentralIndex.rb', line 855

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


878
879
880
881
882
883
884
885
886
887
888
# File 'lib/CentralIndex.rb', line 878

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


897
898
899
900
901
# File 'lib/CentralIndex.rb', line 897

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


923
924
925
926
927
# File 'lib/CentralIndex.rb', line 923

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


990
991
992
993
994
995
996
# File 'lib/CentralIndex.rb', line 990

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, referrer_url, referrer_name) ⇒ 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
@param referrer_url
@param referrer_name
@return - the data from the api


1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
# File 'lib/CentralIndex.rb', line 1039

def postEntityClaim( entity_id, claimed_user_id, claimed_date, claim_method, phone_number, referrer_url, referrer_name)
  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
  params['referrer_url'] = referrer_url
  params['referrer_name'] = referrer_name
  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


1075
1076
1077
1078
1079
1080
1081
# File 'lib/CentralIndex.rb', line 1075

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


1107
1108
1109
1110
1111
1112
1113
# File 'lib/CentralIndex.rb', line 1107

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


1139
1140
1141
1142
1143
1144
1145
# File 'lib/CentralIndex.rb', line 1139

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


1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
# File 'lib/CentralIndex.rb', line 1176

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


1198
1199
1200
1201
1202
1203
1204
# File 'lib/CentralIndex.rb', line 1198

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


1231
1232
1233
1234
1235
1236
1237
1238
# File 'lib/CentralIndex.rb', line 1231

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


1263
1264
1265
1266
1267
1268
# File 'lib/CentralIndex.rb', line 1263

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


1294
1295
1296
1297
1298
1299
1300
# File 'lib/CentralIndex.rb', line 1294

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


1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
# File 'lib/CentralIndex.rb', line 1319

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


1357
1358
1359
1360
1361
1362
1363
# File 'lib/CentralIndex.rb', line 1357

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


1404
1405
1406
1407
1408
1409
1410
# File 'lib/CentralIndex.rb', line 1404

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, override_trust, uncontribute_masheryid, uncontribute_userid, uncontribute_supplierid) ⇒ Object

Merge two entities into one

@param from
@param to
@param override_trust - Do you want to override the trust of the 'from' entity
@param uncontribute_masheryid - Do we want to uncontribute any data for a masheryid?
@param uncontribute_userid - Do we want to uncontribute any data for a user_id?
@param uncontribute_supplierid - Do we want to uncontribute any data for a supplier_id?
@return - the data from the api


1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
# File 'lib/CentralIndex.rb', line 1424

def postEntityMerge( from, to, override_trust, uncontribute_masheryid, uncontribute_userid, uncontribute_supplierid)
  params = Hash.new
  params['from'] = from
  params['to'] = to
  params['override_trust'] = override_trust
  params['uncontribute_masheryid'] = uncontribute_masheryid
  params['uncontribute_userid'] = uncontribute_userid
  params['uncontribute_supplierid'] = uncontribute_supplierid
  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


1444
1445
1446
1447
1448
1449
1450
# File 'lib/CentralIndex.rb', line 1444

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


1461
1462
1463
1464
1465
1466
1467
# File 'lib/CentralIndex.rb', line 1461

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


1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
# File 'lib/CentralIndex.rb', line 1485

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


1522
1523
1524
1525
1526
1527
1528
# File 'lib/CentralIndex.rb', line 1522

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


1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
# File 'lib/CentralIndex.rb', line 1563

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


1838
1839
1840
1841
1842
1843
1844
1845
1846
# File 'lib/CentralIndex.rb', line 1838

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


1872
1873
1874
1875
1876
1877
1878
# File 'lib/CentralIndex.rb', line 1872

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


1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
# File 'lib/CentralIndex.rb', line 1894

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, inactive_reason, inactive_description) ⇒ Object

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

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


1932
1933
1934
1935
1936
1937
1938
1939
# File 'lib/CentralIndex.rb', line 1932

def postEntityStatus( entity_id, status, inactive_reason, inactive_description)
  params = Hash.new
  params['entity_id'] = entity_id
  params['status'] = status
  params['inactive_reason'] = inactive_reason
  params['inactive_description'] = inactive_description
  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


1965
1966
1967
1968
1969
1970
1971
# File 'lib/CentralIndex.rb', line 1965

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


1984
1985
1986
1987
1988
1989
1990
1991
1992
# File 'lib/CentralIndex.rb', line 1984

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


2037
2038
2039
2040
2041
2042
2043
# File 'lib/CentralIndex.rb', line 2037

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


2068
2069
2070
2071
2072
2073
# File 'lib/CentralIndex.rb', line 2068

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


2085
2086
2087
2088
2089
2090
2091
2092
# File 'lib/CentralIndex.rb', line 2085

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, stub, 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, header_menu_bottom, footer_menu, bdpTitle, bdpDescription, bdpAds, serpTitle, serpDescription, serpNumberResults, serpNumberAdverts, serpAds, serpTitleNoWhat, serpDescriptionNoWhat, cookiePolicyUrl, cookiePolicyNotice, addBusinessButtonText, twitterUrl, facebookUrl, copyright, advertUpgradeActive, advertUpgradePrice, advertUpgradeMaxTags, advertUpgradeMaxLocations, advertUpgradeContractLength, advertUpgradeRefId, phoneReveal, loginLinkText, contextLocationId, addBusinessButtonPosition, denyIndexing) ⇒ 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 stub - the stub that is appended to the flatpack's url e.g. http://dev.localhost/stub
@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 header_menu_bottom - the JSON that describes a navigation below the masthead
@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 serpTitleNoWhat - The text to display in the title for where only searches
@param serpDescriptionNoWhat - The text to display in the description for where only searches
@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
@param phoneReveal - record phone number reveal
@param loginLinkText - the link text for the Login link
@param contextLocationId - The location ID to use as the context for searches on this flatpack
@param addBusinessButtonPosition - The location ID to use as the context for searches on this flatpack
@param denyIndexing - Whether to noindex a flatpack
@return - the data from the api


2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
# File 'lib/CentralIndex.rb', line 2216

def postFlatpack( flatpack_id, domainName, stub, 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, header_menu_bottom, footer_menu, bdpTitle, bdpDescription, bdpAds, serpTitle, serpDescription, serpNumberResults, serpNumberAdverts, serpAds, serpTitleNoWhat, serpDescriptionNoWhat, cookiePolicyUrl, cookiePolicyNotice, addBusinessButtonText, twitterUrl, facebookUrl, copyright, advertUpgradeActive, advertUpgradePrice, advertUpgradeMaxTags, advertUpgradeMaxLocations, advertUpgradeContractLength, advertUpgradeRefId, phoneReveal, loginLinkText, contextLocationId, addBusinessButtonPosition, denyIndexing)
  params = Hash.new
  params['flatpack_id'] = flatpack_id
  params['domainName'] = domainName
  params['stub'] = stub
  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['header_menu_bottom'] = header_menu_bottom
  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['serpTitleNoWhat'] = serpTitleNoWhat
  params['serpDescriptionNoWhat'] = serpDescriptionNoWhat
  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
  params['phoneReveal'] = phoneReveal
  params['loginLinkText'] = loginLinkText
  params['contextLocationId'] = contextLocationId
  params['addBusinessButtonPosition'] = addBusinessButtonPosition
  params['denyIndexing'] = denyIndexing
  return doCurl("post","/flatpack",params)
end

#postFlatpackAdminCSS(flatpack_id, filedata) ⇒ Object

Upload a CSS file for the Admin for this flatpack

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


2287
2288
2289
2290
2291
2292
# File 'lib/CentralIndex.rb', line 2287

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

#postFlatpackAdminLargeLogo(flatpack_id, filedata) ⇒ Object

Upload an image to serve out as the large logo in the Admin for this flatpack

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


2302
2303
2304
2305
2306
2307
# File 'lib/CentralIndex.rb', line 2302

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

#postFlatpackAdminSmallLogo(flatpack_id, filedata) ⇒ Object

Upload an image to serve out as the small logo in the Admin for this flatpack

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


2317
2318
2319
2320
2321
2322
# File 'lib/CentralIndex.rb', line 2317

def ( flatpack_id, filedata)
  params = Hash.new
  params['flatpack_id'] = flatpack_id
  params['filedata'] = filedata
  return doCurl("post","/flatpack/adminSmallLogo",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


2371
2372
2373
2374
2375
2376
# File 'lib/CentralIndex.rb', line 2371

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


2403
2404
2405
2406
2407
2408
2409
2410
# File 'lib/CentralIndex.rb', line 2403

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


2420
2421
2422
2423
2424
2425
# File 'lib/CentralIndex.rb', line 2420

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

#postFlatpackSitemap(flatpack_id, filedata) ⇒ Object

Upload a TXT file to act as the sitemap for this flatpack

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


2435
2436
2437
2438
2439
2440
# File 'lib/CentralIndex.rb', line 2435

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

#postFlatpackUpload(filedata) ⇒ Object

Upload a file to our asset server and return the url

@param filedata
@return - the data from the api


2449
2450
2451
2452
2453
# File 'lib/CentralIndex.rb', line 2449

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


2478
2479
2480
2481
2482
2483
2484
2485
# File 'lib/CentralIndex.rb', line 2478

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

#postGroupBulk_update(group_id, data) ⇒ Object

Bulk update entities with a specified group

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


2508
2509
2510
2511
2512
2513
# File 'lib/CentralIndex.rb', line 2508

def postGroupBulk_update( group_id, data)
  params = Hash.new
  params['group_id'] = group_id
  params['data'] = data
  return doCurl("post","/group/bulk_update",params)
end

#postIngest_file(job_id, filedata) ⇒ Object

Process a bulk file

@param job_id
@param filedata - A tab separated file for ingest
@return - the data from the api


2555
2556
2557
2558
2559
2560
# File 'lib/CentralIndex.rb', line 2555

def postIngest_file( job_id, filedata)
  params = Hash.new
  params['job_id'] = job_id
  params['filedata'] = filedata
  return doCurl("post","/ingest_file",params)
end

#postIngest_job(description, category_type) ⇒ Object

Add a ingest job to the collection

@param description
@param category_type
@return - the data from the api


2570
2571
2572
2573
2574
2575
# File 'lib/CentralIndex.rb', line 2570

def postIngest_job( description, category_type)
  params = Hash.new
  params['description'] = description
  params['category_type'] = category_type
  return doCurl("post","/ingest_job",params)
end

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

Create/update a new locz document with the supplied ID in the locations reference database.

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


2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
# File 'lib/CentralIndex.rb', line 2664

def postLocation( location_id, type, country, language, name, formal_name, resolution, population, description, timezone, latitude, longitude, parent_town, parent_county, parent_province, parent_region, parent_neighbourhood, parent_district, postalcode, searchable_id, searchable_ids)
  params = Hash.new
  params['location_id'] = location_id
  params['type'] = type
  params['country'] = country
  params['language'] = language
  params['name'] = name
  params['formal_name'] = formal_name
  params['resolution'] = resolution
  params['population'] = population
  params['description'] = description
  params['timezone'] = timezone
  params['latitude'] = latitude
  params['longitude'] = longitude
  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
  params['searchable_id'] = searchable_id
  params['searchable_ids'] = searchable_ids
  return doCurl("post","/location",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


2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
# File 'lib/CentralIndex.rb', line 2862

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


3054
3055
3056
3057
3058
3059
3060
3061
3062
# File 'lib/CentralIndex.rb', line 3054

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


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

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


3171
3172
3173
3174
3175
3176
# File 'lib/CentralIndex.rb', line 3171

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

#postSales_logEntity(entity_id, country, 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 country - The country code the sales log orginated
@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


3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
# File 'lib/CentralIndex.rb', line 3241

def postSales_logEntity( entity_id, country, 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['country'] = country
  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/entity",params)
end

#postSales_logSyndication(action_type, syndication_type, publisher_id, expiry_date, entity_id, group_id, seed_masheryid, supplier_masheryid, country, reseller_masheryid) ⇒ Object

Add a Sales Log document for a syndication action

@param action_type
@param syndication_type
@param publisher_id
@param expiry_date
@param entity_id
@param group_id
@param seed_masheryid
@param supplier_masheryid
@param country
@param reseller_masheryid
@return - the data from the api


3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
# File 'lib/CentralIndex.rb', line 3274

def postSales_logSyndication( action_type, syndication_type, publisher_id, expiry_date, entity_id, group_id, seed_masheryid, supplier_masheryid, country, reseller_masheryid)
  params = Hash.new
  params['action_type'] = action_type
  params['syndication_type'] = syndication_type
  params['publisher_id'] = publisher_id
  params['expiry_date'] = expiry_date
  params['entity_id'] = entity_id
  params['group_id'] = group_id
  params['seed_masheryid'] = seed_masheryid
  params['supplier_masheryid'] = supplier_masheryid
  params['country'] = country
  params['reseller_masheryid'] = reseller_masheryid
  return doCurl("post","/sales_log/syndication",params)
end

#postSignal(entity_id, country, 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 country - The country code from where the signal originated e.g. ie
@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


3300
3301
3302
3303
3304
3305
3306
3307
3308
# File 'lib/CentralIndex.rb', line 3300

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

#postSyndication_log(entity_id, publisher_id, action, success, message, syndicated_id) ⇒ Object

When we get a syndication update make a record of it

@param entity_id - The entity to pull
@param publisher_id - The publisher this log entry refers to
@param action - The log type
@param success - If the syndication was successful
@param message - An optional message e.g. submitted to the syndication partner
@param syndicated_id - The entity as known to the publisher
@return - the data from the api


3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
# File 'lib/CentralIndex.rb', line 3394

def postSyndication_log( entity_id, publisher_id, action, success, message, syndicated_id)
  params = Hash.new
  params['entity_id'] = entity_id
  params['publisher_id'] = publisher_id
  params['action'] = action
  params['success'] = success
  params['message'] = message
  params['syndicated_id'] = syndicated_id
  return doCurl("post","/syndication_log",params)
end

#postSyndicationCreate(syndication_type, publisher_id, expiry_date, entity_id, group_id, seed_masheryid, supplier_masheryid, country, reseller_masheryid) ⇒ Object

Add a Syndicate

@param syndication_type
@param publisher_id
@param expiry_date
@param entity_id
@param group_id
@param seed_masheryid
@param supplier_masheryid
@param country
@param reseller_masheryid
@return - the data from the api


3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
# File 'lib/CentralIndex.rb', line 3368

def postSyndicationCreate( syndication_type, publisher_id, expiry_date, entity_id, group_id, seed_masheryid, supplier_masheryid, country, reseller_masheryid)
  params = Hash.new
  params['syndication_type'] = syndication_type
  params['publisher_id'] = publisher_id
  params['expiry_date'] = expiry_date
  params['entity_id'] = entity_id
  params['group_id'] = group_id
  params['seed_masheryid'] = seed_masheryid
  params['supplier_masheryid'] = supplier_masheryid
  params['country'] = country
  params['reseller_masheryid'] = reseller_masheryid
  return doCurl("post","/syndication/create",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


3673
3674
3675
3676
3677
3678
# File 'lib/CentralIndex.rb', line 3673

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

#postToolsImage(filedata, type) ⇒ Object

Given some image data we can resize and upload the images

@param filedata - The image data to upload and resize
@param type - The type of image to upload and resize
@return - the data from the api


3688
3689
3690
3691
3692
3693
# File 'lib/CentralIndex.rb', line 3688

def postToolsImage( filedata, type)
  params = Hash.new
  params['filedata'] = filedata
  params['type'] = type
  return doCurl("post","/tools/image",params)
end

#postTraction(traction_id, trigger_type, action_type, country, email_addresses, title, body, api_method, api_url, api_params, active, reseller_masheryid, publisher_masheryid, description) ⇒ 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
@param reseller_masheryid
@param publisher_masheryid
@param description
@return - the data from the api


3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
# File 'lib/CentralIndex.rb', line 3932

def postTraction( traction_id, trigger_type, action_type, country, email_addresses, title, body, api_method, api_url, api_params, active, reseller_masheryid, publisher_masheryid, description)
  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
  params['reseller_masheryid'] = reseller_masheryid
  params['publisher_masheryid'] = publisher_masheryid
  params['description'] = description
  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


4019
4020
4021
4022
4023
4024
# File 'lib/CentralIndex.rb', line 4019

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


4046
4047
4048
4049
4050
# File 'lib/CentralIndex.rb', line 4046

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


4062
4063
4064
4065
4066
4067
4068
4069
# File 'lib/CentralIndex.rb', line 4062

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


4079
4080
4081
4082
4083
4084
# File 'lib/CentralIndex.rb', line 4079

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, user_id, first_name, last_name, active, trust, creation_date, user_type, social_network, social_network_id, reseller_admin_masheryid, group_id, admin_upgrader) ⇒ Object

Update user based on email address or social_network/social_network_id

@param email
@param user_id
@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
@param group_id
@param admin_upgrader
@return - the data from the api


4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
# File 'lib/CentralIndex.rb', line 4105

def postUser( email, user_id, first_name, last_name, active, trust, creation_date, user_type, social_network, social_network_id, reseller_admin_masheryid, group_id, admin_upgrader)
  params = Hash.new
  params['email'] = email
  params['user_id'] = user_id
  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
  params['group_id'] = group_id
  params['admin_upgrader'] = admin_upgrader
  return doCurl("post","/user",params)
end

#postUserGroup_admin_remove(user_id) ⇒ Object

Removes group_admin privileges from a specified user

@param user_id
@return - the data from the api


4197
4198
4199
4200
4201
# File 'lib/CentralIndex.rb', line 4197

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

#postUserReseller_remove(user_id) ⇒ Object

Removes reseller privileges from a specified user

@param user_id
@return - the data from the api


4210
4211
4212
4213
4214
# File 'lib/CentralIndex.rb', line 4210

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, additional_telephone_number, email, website, category_id, category_type, do_not_display, referrer_url, referrer_name) ⇒ 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 additional_telephone_number
@param email
@param website
@param category_id
@param category_type
@param do_not_display
@param referrer_url
@param referrer_name
@return - the data from the api


234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# File 'lib/CentralIndex.rb', line 234

def putBusiness( name, building_number, address1, address2, address3, district, town, county, province, postcode, country, latitude, longitude, timezone, telephone_number, additional_telephone_number, email, website, category_id, category_type, do_not_display, referrer_url, referrer_name)
  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['additional_telephone_number'] = additional_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
  params['referrer_url'] = referrer_url
  params['referrer_name'] = referrer_name
  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


348
349
350
351
352
353
354
# File 'lib/CentralIndex.rb', line 348

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


622
623
624
625
626
627
628
629
630
# File 'lib/CentralIndex.rb', line 622

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


2118
2119
2120
2121
2122
2123
2124
# File 'lib/CentralIndex.rb', line 2118

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


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

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


2910
2911
2912
2913
2914
2915
# File 'lib/CentralIndex.rb', line 2910

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


3126
3127
3128
3129
3130
3131
# File 'lib/CentralIndex.rb', line 3126

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


3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
# File 'lib/CentralIndex.rb', line 3987

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