centralindex 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/CentralIndex.rb +1226 -74
  2. metadata +2 -2
data/lib/CentralIndex.rb CHANGED
@@ -115,6 +115,19 @@ class CentralIndex
115
115
  end
116
116
 
117
117
 
118
+ #
119
+ # Uploads a JSON file of known format and bulk inserts into DB
120
+ #
121
+ # @param data
122
+ # @return - the data from the api
123
+ #
124
+ def postEntityBulkJson( data)
125
+ params = Hash.new
126
+ params['data'] = data
127
+ return doCurl("post","/entity/bulk/json",params)
128
+ end
129
+
130
+
118
131
  #
119
132
  # Shows the current status of a bulk upload
120
133
  #
@@ -128,6 +141,19 @@ class CentralIndex
128
141
  end
129
142
 
130
143
 
144
+ #
145
+ # Shows the current status of a bulk JSON upload
146
+ #
147
+ # @param upload_id
148
+ # @return - the data from the api
149
+ #
150
+ def getEntityBulkJsonStatus( upload_id)
151
+ params = Hash.new
152
+ params['upload_id'] = upload_id
153
+ return doCurl("get","/entity/bulk/json/status",params)
154
+ end
155
+
156
+
131
157
  #
132
158
  # This entity isn't really supported anymore. You probably want PUT /business. Only to be used for testing.
133
159
  #
@@ -217,14 +243,14 @@ class CentralIndex
217
243
  #
218
244
  # Search for matching entities
219
245
  #
220
- # @param what
221
- # @param latitude_1
222
- # @param longitude_1
223
- # @param latitude_2
224
- # @param longitude_2
246
+ # @param what - What to get results for. E.g. Plumber e.g. plumber
247
+ # @param latitude_1 - Latitude of first point in bounding box e.g. 53.396842
248
+ # @param longitude_1 - Longitude of first point in bounding box e.g. -6.37619
249
+ # @param latitude_2 - Latitude of second point in bounding box e.g. 53.290463
250
+ # @param longitude_2 - Longitude of second point in bounding box e.g. -6.207275
225
251
  # @param per_page
226
252
  # @param page
227
- # @param country
253
+ # @param country - A valid ISO 3166 country code e.g. ie
228
254
  # @param language
229
255
  # @return - the data from the api
230
256
  #
@@ -510,36 +536,6 @@ class CentralIndex
510
536
  end
511
537
 
512
538
 
513
- #
514
- # Supply an entity and an object within it (e.g. a phone number), and retrieve a URL that allows the user to report an issue with that object
515
- #
516
- # @param entity_id - The unique Entity ID e.g. 379236608286720
517
- # @param gen_id - A Unique ID for the object you wish to report, E.g. Phone number e.g. 379236608299008
518
- # @param language
519
- # @return - the data from the api
520
- #
521
- def getEntityReport( entity_id, gen_id, language)
522
- params = Hash.new
523
- params['entity_id'] = entity_id
524
- params['gen_id'] = gen_id
525
- params['language'] = language
526
- return doCurl("get","/entity/report",params)
527
- end
528
-
529
-
530
- #
531
- # Allows us to identify the user, entity and element from an encoded endpoint URL's token
532
- #
533
- # @param token
534
- # @return - the data from the api
535
- #
536
- def getToolsDecodereport( token)
537
- params = Hash.new
538
- params['token'] = token
539
- return doCurl("get","/tools/decodereport",params)
540
- end
541
-
542
-
543
539
  #
544
540
  # Update entities that use an old category ID to a new one
545
541
  #
@@ -576,10 +572,11 @@ class CentralIndex
576
572
  # @param email
577
573
  # @param website
578
574
  # @param category_id
579
- # @param category_name
575
+ # @param category_type
576
+ # @param do_not_display
580
577
  # @return - the data from the api
581
578
  #
582
- def putBusiness( name, address1, address2, address3, district, town, county, postcode, country, latitude, longitude, timezone, telephone_number, email, website, category_id, category_name)
579
+ def putBusiness( name, address1, address2, address3, district, town, county, postcode, country, latitude, longitude, timezone, telephone_number, email, website, category_id, category_type, do_not_display)
583
580
  params = Hash.new
584
581
  params['name'] = name
585
582
  params['address1'] = address1
@@ -597,23 +594,30 @@ class CentralIndex
597
594
  params['email'] = email
598
595
  params['website'] = website
599
596
  params['category_id'] = category_id
600
- params['category_name'] = category_name
597
+ params['category_type'] = category_type
598
+ params['do_not_display'] = do_not_display
601
599
  return doCurl("put","/business",params)
602
600
  end
603
601
 
604
602
 
605
603
  #
606
- # Provides a personalised URL to redirect a user to add an entity to Central Index
604
+ # Allows the removal or insertion of tags into an advertiser object
607
605
  #
608
- # @param language - The language to use to render the add path e.g. en
609
- # @param portal_name - The name of the website that data is to be added on e.g. YourLocal
606
+ # @param gen_id - The gen_id of this advertiser
607
+ # @param entity_id - The entity_id of the advertiser
608
+ # @param language - The tag language to alter
609
+ # @param tags_to_add - The tags to add
610
+ # @param tags_to_remove - The tags to remove
610
611
  # @return - the data from the api
611
612
  #
612
- def getEntityAdd( language, portal_name)
613
+ def postEntityAdvertiserTag( gen_id, entity_id, language, tags_to_add, tags_to_remove)
613
614
  params = Hash.new
615
+ params['gen_id'] = gen_id
616
+ params['entity_id'] = entity_id
614
617
  params['language'] = language
615
- params['portal_name'] = portal_name
616
- return doCurl("get","/entity/add",params)
618
+ params['tags_to_add'] = tags_to_add
619
+ params['tags_to_remove'] = tags_to_remove
620
+ return doCurl("post","/entity/advertiser/tag",params)
617
621
  end
618
622
 
619
623
 
@@ -662,6 +666,34 @@ class CentralIndex
662
666
  end
663
667
 
664
668
 
669
+ #
670
+ # Find all the parents locations of the selected location
671
+ #
672
+ # @param location_id
673
+ # @return - the data from the api
674
+ #
675
+ def getLookupLocationParents( location_id)
676
+ params = Hash.new
677
+ params['location_id'] = location_id
678
+ return doCurl("get","/lookup/location/parents",params)
679
+ end
680
+
681
+
682
+ #
683
+ # Find all the child locations of the selected location
684
+ #
685
+ # @param location_id
686
+ # @param resolution
687
+ # @return - the data from the api
688
+ #
689
+ def getLookupLocationChildren( location_id, resolution)
690
+ params = Hash.new
691
+ params['location_id'] = location_id
692
+ params['resolution'] = resolution
693
+ return doCurl("get","/lookup/location/children",params)
694
+ end
695
+
696
+
665
697
  #
666
698
  # With a known entity id, a name can be updated.
667
699
  #
@@ -895,19 +927,32 @@ class CentralIndex
895
927
  end
896
928
 
897
929
 
930
+ #
931
+ # Returns the supplied wolf category object by fetching the supplied category_id from our categories object.
932
+ #
933
+ # @param category_id
934
+ # @return - the data from the api
935
+ #
936
+ def getCategory( category_id)
937
+ params = Hash.new
938
+ params['category_id'] = category_id
939
+ return doCurl("get","/category",params)
940
+ end
941
+
942
+
898
943
  #
899
944
  # With a known entity id, an category object can be added.
900
945
  #
901
946
  # @param entity_id
902
947
  # @param category_id
903
- # @param category_name
948
+ # @param category_type
904
949
  # @return - the data from the api
905
950
  #
906
- def postEntityCategory( entity_id, category_id, category_name)
951
+ def postEntityCategory( entity_id, category_id, category_type)
907
952
  params = Hash.new
908
953
  params['entity_id'] = entity_id
909
954
  params['category_id'] = category_id
910
- params['category_name'] = category_name
955
+ params['category_type'] = category_type
911
956
  return doCurl("post","/entity/category",params)
912
957
  end
913
958
 
@@ -953,16 +998,18 @@ class CentralIndex
953
998
  # @param company_name
954
999
  # @param latitude
955
1000
  # @param longitude
1001
+ # @param country
956
1002
  # @param name_strictness
957
1003
  # @param location_strictness
958
1004
  # @return - the data from the api
959
1005
  #
960
- def getMatchByphone( phone, company_name, latitude, longitude, name_strictness, location_strictness)
1006
+ def getMatchByphone( phone, company_name, latitude, longitude, country, name_strictness, location_strictness)
961
1007
  params = Hash.new
962
1008
  params['phone'] = phone
963
1009
  params['company_name'] = company_name
964
1010
  params['latitude'] = latitude
965
1011
  params['longitude'] = longitude
1012
+ params['country'] = country
966
1013
  params['name_strictness'] = name_strictness
967
1014
  params['location_strictness'] = location_strictness
968
1015
  return doCurl("get","/match/byphone",params)
@@ -1059,11 +1106,15 @@ class CentralIndex
1059
1106
  # Spider a single url looking for key facts
1060
1107
  #
1061
1108
  # @param url
1109
+ # @param pages
1110
+ # @param country
1062
1111
  # @return - the data from the api
1063
1112
  #
1064
- def getToolsSpider( url)
1113
+ def getToolsSpider( url, pages, country)
1065
1114
  params = Hash.new
1066
1115
  params['url'] = url
1116
+ params['pages'] = pages
1117
+ params['country'] = country
1067
1118
  return doCurl("get","/tools/spider",params)
1068
1119
  end
1069
1120
 
@@ -1071,12 +1122,26 @@ class CentralIndex
1071
1122
  #
1072
1123
  # Supply an address to geocode - returns lat/lon and accuracy
1073
1124
  #
1074
- # @param address
1125
+ # @param address1
1126
+ # @param address2
1127
+ # @param address3
1128
+ # @param district
1129
+ # @param town
1130
+ # @param county
1131
+ # @param postcode
1132
+ # @param country
1075
1133
  # @return - the data from the api
1076
1134
  #
1077
- def getToolsGeocode( address)
1135
+ def getToolsGeocode( address1, address2, address3, district, town, county, postcode, country)
1078
1136
  params = Hash.new
1079
- params['address'] = address
1137
+ params['address1'] = address1
1138
+ params['address2'] = address2
1139
+ params['address3'] = address3
1140
+ params['district'] = district
1141
+ params['town'] = town
1142
+ params['county'] = county
1143
+ params['postcode'] = postcode
1144
+ params['country'] = country
1080
1145
  return doCurl("get","/tools/geocode",params)
1081
1146
  end
1082
1147
 
@@ -1145,6 +1210,79 @@ class CentralIndex
1145
1210
  end
1146
1211
 
1147
1212
 
1213
+ #
1214
+ # Check to see if a supplied email address is valid
1215
+ #
1216
+ # @param email_address - The email address to validate
1217
+ # @return - the data from the api
1218
+ #
1219
+ def getToolsValidate_email( email_address)
1220
+ params = Hash.new
1221
+ params['email_address'] = email_address
1222
+ return doCurl("get","/tools/validate_email",params)
1223
+ end
1224
+
1225
+
1226
+ #
1227
+ # compile the supplied less with the standard Bootstrap less into a CSS file
1228
+ #
1229
+ # @param less - The LESS code to compile
1230
+ # @return - the data from the api
1231
+ #
1232
+ def getToolsLess( less)
1233
+ params = Hash.new
1234
+ params['less'] = less
1235
+ return doCurl("get","/tools/less",params)
1236
+ end
1237
+
1238
+
1239
+ #
1240
+ # replace some text parameters with some entity details
1241
+ #
1242
+ # @param entity_id - The entity to pull for replacements
1243
+ # @param string - The string full of parameters
1244
+ # @return - the data from the api
1245
+ #
1246
+ def getToolsReplace( entity_id, string)
1247
+ params = Hash.new
1248
+ params['entity_id'] = entity_id
1249
+ params['string'] = string
1250
+ return doCurl("get","/tools/replace",params)
1251
+ end
1252
+
1253
+
1254
+ #
1255
+ # Check to see if a supplied email address is valid
1256
+ #
1257
+ # @param from - The phone number from which the SMS orginates
1258
+ # @param to - The phone number to which the SMS is to be sent
1259
+ # @param message - The message to be sent in the SMS
1260
+ # @return - the data from the api
1261
+ #
1262
+ def getToolsSendsms( from, to, message)
1263
+ params = Hash.new
1264
+ params['from'] = from
1265
+ params['to'] = to
1266
+ params['message'] = message
1267
+ return doCurl("get","/tools/sendsms",params)
1268
+ end
1269
+
1270
+
1271
+ #
1272
+ # Given a spreadsheet id add a row
1273
+ #
1274
+ # @param spreadsheet_key - The key of the spreadsheet to edit
1275
+ # @param data - A comma separated list to add as cells
1276
+ # @return - the data from the api
1277
+ #
1278
+ def postToolsGooglesheetAdd_row( spreadsheet_key, data)
1279
+ params = Hash.new
1280
+ params['spreadsheet_key'] = spreadsheet_key
1281
+ params['data'] = data
1282
+ return doCurl("post","/tools/googlesheet/add_row",params)
1283
+ end
1284
+
1285
+
1148
1286
  #
1149
1287
  # With a known entity id, an invoice_address object can be updated.
1150
1288
  #
@@ -1231,9 +1369,10 @@ class CentralIndex
1231
1369
  # @param county
1232
1370
  # @param postcode
1233
1371
  # @param address_type
1372
+ # @param do_not_display
1234
1373
  # @return - the data from the api
1235
1374
  #
1236
- def postEntityPostal_address( entity_id, address1, address2, address3, district, town, county, postcode, address_type)
1375
+ def postEntityPostal_address( entity_id, address1, address2, address3, district, town, county, postcode, address_type, do_not_display)
1237
1376
  params = Hash.new
1238
1377
  params['entity_id'] = entity_id
1239
1378
  params['address1'] = address1
@@ -1244,6 +1383,7 @@ class CentralIndex
1244
1383
  params['county'] = county
1245
1384
  params['postcode'] = postcode
1246
1385
  params['address_type'] = address_type
1386
+ params['do_not_display'] = do_not_display
1247
1387
  return doCurl("post","/entity/postal_address",params)
1248
1388
  end
1249
1389
 
@@ -1254,20 +1394,101 @@ class CentralIndex
1254
1394
  # @param entity_id
1255
1395
  # @param tags
1256
1396
  # @param locations
1257
- # @param expiry
1397
+ # @param max_tags
1398
+ # @param max_locations
1399
+ # @param expiry_date
1400
+ # @param is_national
1401
+ # @param language
1402
+ # @param reseller_ref
1403
+ # @param reseller_agent_id
1404
+ # @param publisher_id
1405
+ # @return - the data from the api
1406
+ #
1407
+ def postEntityAdvertiserCreate( entity_id, tags, locations, max_tags, max_locations, expiry_date, is_national, language, reseller_ref, reseller_agent_id, publisher_id)
1408
+ params = Hash.new
1409
+ params['entity_id'] = entity_id
1410
+ params['tags'] = tags
1411
+ params['locations'] = locations
1412
+ params['max_tags'] = max_tags
1413
+ params['max_locations'] = max_locations
1414
+ params['expiry_date'] = expiry_date
1415
+ params['is_national'] = is_national
1416
+ params['language'] = language
1417
+ params['reseller_ref'] = reseller_ref
1418
+ params['reseller_agent_id'] = reseller_agent_id
1419
+ params['publisher_id'] = publisher_id
1420
+ return doCurl("post","/entity/advertiser/create",params)
1421
+ end
1422
+
1423
+
1424
+ #
1425
+ # With a known entity id, an advertiser is updated
1426
+ #
1427
+ # @param entity_id
1428
+ # @param tags
1429
+ # @param locations
1430
+ # @param extra_tags
1431
+ # @param extra_locations
1258
1432
  # @param is_national
1259
1433
  # @param language
1434
+ # @param reseller_ref
1435
+ # @param reseller_agent_id
1436
+ # @param publisher_id
1260
1437
  # @return - the data from the api
1261
1438
  #
1262
- def postEntityAdvertiser( entity_id, tags, locations, expiry, is_national, language)
1439
+ def postEntityAdvertiserUpsell( entity_id, tags, locations, extra_tags, extra_locations, is_national, language, reseller_ref, reseller_agent_id, publisher_id)
1263
1440
  params = Hash.new
1264
1441
  params['entity_id'] = entity_id
1265
1442
  params['tags'] = tags
1266
1443
  params['locations'] = locations
1267
- params['expiry'] = expiry
1444
+ params['extra_tags'] = extra_tags
1445
+ params['extra_locations'] = extra_locations
1268
1446
  params['is_national'] = is_national
1269
1447
  params['language'] = language
1270
- return doCurl("post","/entity/advertiser",params)
1448
+ params['reseller_ref'] = reseller_ref
1449
+ params['reseller_agent_id'] = reseller_agent_id
1450
+ params['publisher_id'] = publisher_id
1451
+ return doCurl("post","/entity/advertiser/upsell",params)
1452
+ end
1453
+
1454
+
1455
+ #
1456
+ # Expires an advertiser from and entity
1457
+ #
1458
+ # @param entity_id
1459
+ # @param publisher_id
1460
+ # @param reseller_ref
1461
+ # @param reseller_agent_id
1462
+ # @return - the data from the api
1463
+ #
1464
+ def postEntityAdvertiserCancel( entity_id, publisher_id, reseller_ref, reseller_agent_id)
1465
+ params = Hash.new
1466
+ params['entity_id'] = entity_id
1467
+ params['publisher_id'] = publisher_id
1468
+ params['reseller_ref'] = reseller_ref
1469
+ params['reseller_agent_id'] = reseller_agent_id
1470
+ return doCurl("post","/entity/advertiser/cancel",params)
1471
+ end
1472
+
1473
+
1474
+ #
1475
+ # Renews an advertiser from an entity
1476
+ #
1477
+ # @param entity_id
1478
+ # @param expiry_date
1479
+ # @param publisher_id
1480
+ # @param reseller_ref
1481
+ # @param reseller_agent_id
1482
+ # @return - the data from the api
1483
+ #
1484
+ def postEntityAdvertiserRenew( entity_id, expiry_date, publisher_id, reseller_ref, reseller_agent_id)
1485
+ params = Hash.new
1486
+ params['entity_id'] = entity_id
1487
+ params['expiry_date'] = expiry_date
1488
+ params['publisher_id'] = publisher_id
1489
+ params['reseller_ref'] = reseller_ref
1490
+ params['reseller_agent_id'] = reseller_agent_id
1491
+ return doCurl("post","/entity/advertiser/renew",params)
1271
1492
  end
1272
1493
 
1273
1494
 
@@ -1286,6 +1507,25 @@ class CentralIndex
1286
1507
  end
1287
1508
 
1288
1509
 
1510
+ #
1511
+ # Adds/removes locations
1512
+ #
1513
+ # @param entity_id
1514
+ # @param gen_id
1515
+ # @param locations_to_add
1516
+ # @param locations_to_remove
1517
+ # @return - the data from the api
1518
+ #
1519
+ def postEntityAdvertiserLocation( entity_id, gen_id, locations_to_add, locations_to_remove)
1520
+ params = Hash.new
1521
+ params['entity_id'] = entity_id
1522
+ params['gen_id'] = gen_id
1523
+ params['locations_to_add'] = locations_to_add
1524
+ params['locations_to_remove'] = locations_to_remove
1525
+ return doCurl("post","/entity/advertiser/location",params)
1526
+ end
1527
+
1528
+
1289
1529
  #
1290
1530
  # With a known entity id, an email address object can be added.
1291
1531
  #
@@ -1397,6 +1637,19 @@ class CentralIndex
1397
1637
  end
1398
1638
 
1399
1639
 
1640
+ #
1641
+ # Read multiple locations with the supplied ID in the locations reference database.
1642
+ #
1643
+ # @param location_ids
1644
+ # @return - the data from the api
1645
+ #
1646
+ def getLocationMultiple( location_ids)
1647
+ params = Hash.new
1648
+ params['location_ids'] = location_ids
1649
+ return doCurl("get","/location/multiple",params)
1650
+ end
1651
+
1652
+
1400
1653
  #
1401
1654
  # Create/update a new location entity with the supplied ID in the locations reference database.
1402
1655
  #
@@ -1412,9 +1665,16 @@ class CentralIndex
1412
1665
  # @param timezone
1413
1666
  # @param is_duplicate
1414
1667
  # @param is_default
1668
+ # @param parent_town
1669
+ # @param parent_county
1670
+ # @param parent_province
1671
+ # @param parent_region
1672
+ # @param parent_neighbourhood
1673
+ # @param parent_district
1674
+ # @param postalcode
1415
1675
  # @return - the data from the api
1416
1676
  #
1417
- def postLocation( location_id, name, formal_name, latitude, longitude, resolution, country, population, description, timezone, is_duplicate, is_default)
1677
+ def postLocation( location_id, name, formal_name, latitude, longitude, resolution, country, population, description, timezone, is_duplicate, is_default, parent_town, parent_county, parent_province, parent_region, parent_neighbourhood, parent_district, postalcode)
1418
1678
  params = Hash.new
1419
1679
  params['location_id'] = location_id
1420
1680
  params['name'] = name
@@ -1428,6 +1688,13 @@ class CentralIndex
1428
1688
  params['timezone'] = timezone
1429
1689
  params['is_duplicate'] = is_duplicate
1430
1690
  params['is_default'] = is_default
1691
+ params['parent_town'] = parent_town
1692
+ params['parent_county'] = parent_county
1693
+ params['parent_province'] = parent_province
1694
+ params['parent_region'] = parent_region
1695
+ params['parent_neighbourhood'] = parent_neighbourhood
1696
+ params['parent_district'] = parent_district
1697
+ params['postalcode'] = postalcode
1431
1698
  return doCurl("post","/location",params)
1432
1699
  end
1433
1700
 
@@ -1533,23 +1800,17 @@ class CentralIndex
1533
1800
 
1534
1801
 
1535
1802
  #
1536
- # With a known entity id, avideo object can be added.
1803
+ # With a known entity id, a YouTube video object can be added.
1537
1804
  #
1538
1805
  # @param entity_id
1539
- # @param title
1540
- # @param description
1541
- # @param thumbnail
1542
1806
  # @param embed_code
1543
1807
  # @return - the data from the api
1544
1808
  #
1545
- def postEntityVideo( entity_id, title, description, thumbnail, embed_code)
1809
+ def postEntityVideoYoutube( entity_id, embed_code)
1546
1810
  params = Hash.new
1547
1811
  params['entity_id'] = entity_id
1548
- params['title'] = title
1549
- params['description'] = description
1550
- params['thumbnail'] = thumbnail
1551
1812
  params['embed_code'] = embed_code
1552
- return doCurl("post","/entity/video",params)
1813
+ return doCurl("post","/entity/video/youtube",params)
1553
1814
  end
1554
1815
 
1555
1816
 
@@ -1821,9 +2082,10 @@ class CentralIndex
1821
2082
  # @param user_type
1822
2083
  # @param social_network
1823
2084
  # @param social_network_id
2085
+ # @param reseller_admin_masheryid
1824
2086
  # @return - the data from the api
1825
2087
  #
1826
- def postUser( email, first_name, last_name, active, trust, creation_date, user_type, social_network, social_network_id)
2088
+ def postUser( email, first_name, last_name, active, trust, creation_date, user_type, social_network, social_network_id, reseller_admin_masheryid)
1827
2089
  params = Hash.new
1828
2090
  params['email'] = email
1829
2091
  params['first_name'] = first_name
@@ -1834,6 +2096,7 @@ class CentralIndex
1834
2096
  params['user_type'] = user_type
1835
2097
  params['social_network'] = social_network
1836
2098
  params['social_network_id'] = social_network_id
2099
+ params['reseller_admin_masheryid'] = reseller_admin_masheryid
1837
2100
  return doCurl("post","/user",params)
1838
2101
  end
1839
2102
 
@@ -1880,7 +2143,33 @@ class CentralIndex
1880
2143
 
1881
2144
 
1882
2145
  #
1883
- # The search matches a category name or synonym on a given string and language.
2146
+ # Returns all the users that match the supplied reseller_admin_masheryid
2147
+ #
2148
+ # @param reseller_admin_masheryid
2149
+ # @return - the data from the api
2150
+ #
2151
+ def getUserBy_reseller_admin_masheryid( reseller_admin_masheryid)
2152
+ params = Hash.new
2153
+ params['reseller_admin_masheryid'] = reseller_admin_masheryid
2154
+ return doCurl("get","/user/by_reseller_admin_masheryid",params)
2155
+ end
2156
+
2157
+
2158
+ #
2159
+ # Removes reseller privileges from a specified user
2160
+ #
2161
+ # @param user_id
2162
+ # @return - the data from the api
2163
+ #
2164
+ def postUserReseller_remove( user_id)
2165
+ params = Hash.new
2166
+ params['user_id'] = user_id
2167
+ return doCurl("post","/user/reseller_remove",params)
2168
+ end
2169
+
2170
+
2171
+ #
2172
+ # The search matches a category name on a given string and language.
1884
2173
  #
1885
2174
  # @param str - A string to search against, E.g. Plumbers e.g. but
1886
2175
  # @param language - An ISO compatible language code, E.g. en e.g. en
@@ -1894,6 +2183,21 @@ class CentralIndex
1894
2183
  end
1895
2184
 
1896
2185
 
2186
+ #
2187
+ # The search matches a category name or synonym on a given string and language.
2188
+ #
2189
+ # @param str - A string to search against, E.g. Plumbers e.g. but
2190
+ # @param language - An ISO compatible language code, E.g. en e.g. en
2191
+ # @return - the data from the api
2192
+ #
2193
+ def getAutocompleteKeyword( str, language)
2194
+ params = Hash.new
2195
+ params['str'] = str
2196
+ params['language'] = language
2197
+ return doCurl("get","/autocomplete/keyword",params)
2198
+ end
2199
+
2200
+
1897
2201
  #
1898
2202
  # The search matches a location name or synonym on a given string and language.
1899
2203
  #
@@ -1910,10 +2214,25 @@ class CentralIndex
1910
2214
 
1911
2215
 
1912
2216
  #
1913
- # Create a queue item
2217
+ # The search matches a postcode to the supplied string
1914
2218
  #
1915
- # @param queue_name
1916
- # @param data
2219
+ # @param str - A string to search against, E.g. W1 e.g. W1
2220
+ # @param country - Which country to return results for. An ISO compatible country code, E.g. gb e.g. gb
2221
+ # @return - the data from the api
2222
+ #
2223
+ def getAutocompletePostcode( str, country)
2224
+ params = Hash.new
2225
+ params['str'] = str
2226
+ params['country'] = country
2227
+ return doCurl("get","/autocomplete/postcode",params)
2228
+ end
2229
+
2230
+
2231
+ #
2232
+ # Create a queue item
2233
+ #
2234
+ # @param queue_name
2235
+ # @param data
1917
2236
  # @return - the data from the api
1918
2237
  #
1919
2238
  def putQueue( queue_name, data)
@@ -2114,16 +2433,849 @@ class CentralIndex
2114
2433
  # @param entity_id
2115
2434
  # @param claimed_user_id
2116
2435
  # @param claimed_date
2436
+ # @param claim_method
2437
+ # @param phone_number
2117
2438
  # @return - the data from the api
2118
2439
  #
2119
- def postEntityClaim( entity_id, claimed_user_id, claimed_date)
2440
+ def postEntityClaim( entity_id, claimed_user_id, claimed_date, claim_method, phone_number)
2120
2441
  params = Hash.new
2121
2442
  params['entity_id'] = entity_id
2122
2443
  params['claimed_user_id'] = claimed_user_id
2123
2444
  params['claimed_date'] = claimed_date
2445
+ params['claim_method'] = claim_method
2446
+ params['phone_number'] = phone_number
2124
2447
  return doCurl("post","/entity/claim",params)
2125
2448
  end
2126
2449
 
2127
2450
 
2451
+ #
2452
+ # Update/Add a publisher
2453
+ #
2454
+ # @param publisher_id
2455
+ # @param country
2456
+ # @param name
2457
+ # @param description
2458
+ # @param active
2459
+ # @return - the data from the api
2460
+ #
2461
+ def postPublisher( publisher_id, country, name, description, active)
2462
+ params = Hash.new
2463
+ params['publisher_id'] = publisher_id
2464
+ params['country'] = country
2465
+ params['name'] = name
2466
+ params['description'] = description
2467
+ params['active'] = active
2468
+ return doCurl("post","/publisher",params)
2469
+ end
2470
+
2471
+
2472
+ #
2473
+ # Delete a publisher with a specified publisher_id
2474
+ #
2475
+ # @param publisher_id
2476
+ # @return - the data from the api
2477
+ #
2478
+ def deletePublisher( publisher_id)
2479
+ params = Hash.new
2480
+ params['publisher_id'] = publisher_id
2481
+ return doCurl("delete","/publisher",params)
2482
+ end
2483
+
2484
+
2485
+ #
2486
+ # Returns publisher that matches a given publisher id
2487
+ #
2488
+ # @param publisher_id
2489
+ # @return - the data from the api
2490
+ #
2491
+ def getPublisher( publisher_id)
2492
+ params = Hash.new
2493
+ params['publisher_id'] = publisher_id
2494
+ return doCurl("get","/publisher",params)
2495
+ end
2496
+
2497
+
2498
+ #
2499
+ # Returns publisher that matches a given publisher id
2500
+ #
2501
+ # @param country
2502
+ # @return - the data from the api
2503
+ #
2504
+ def getPublisherByCountry( country)
2505
+ params = Hash.new
2506
+ params['country'] = country
2507
+ return doCurl("get","/publisher/byCountry",params)
2508
+ end
2509
+
2510
+
2511
+ #
2512
+ # Returns publishers that are available for a given entity_id.
2513
+ #
2514
+ # @param entity_id
2515
+ # @return - the data from the api
2516
+ #
2517
+ def getPublisherByEntityId( entity_id)
2518
+ params = Hash.new
2519
+ params['entity_id'] = entity_id
2520
+ return doCurl("get","/publisher/byEntityId",params)
2521
+ end
2522
+
2523
+
2524
+ #
2525
+ # Update/Add a country
2526
+ #
2527
+ # @param country_id
2528
+ # @param name
2529
+ # @param synonyms
2530
+ # @param continentName
2531
+ # @param continent
2532
+ # @param geonameId
2533
+ # @param dbpediaURL
2534
+ # @param freebaseURL
2535
+ # @param population
2536
+ # @param currencyCode
2537
+ # @param languages
2538
+ # @param areaInSqKm
2539
+ # @param capital
2540
+ # @param east
2541
+ # @param west
2542
+ # @param north
2543
+ # @param south
2544
+ # @param claimPrice
2545
+ # @param claimMethods
2546
+ # @return - the data from the api
2547
+ #
2548
+ def postCountry( country_id, name, synonyms, continentName, continent, geonameId, dbpediaURL, freebaseURL, population, currencyCode, languages, areaInSqKm, capital, east, west, north, south, claimPrice, claimMethods)
2549
+ params = Hash.new
2550
+ params['country_id'] = country_id
2551
+ params['name'] = name
2552
+ params['synonyms'] = synonyms
2553
+ params['continentName'] = continentName
2554
+ params['continent'] = continent
2555
+ params['geonameId'] = geonameId
2556
+ params['dbpediaURL'] = dbpediaURL
2557
+ params['freebaseURL'] = freebaseURL
2558
+ params['population'] = population
2559
+ params['currencyCode'] = currencyCode
2560
+ params['languages'] = languages
2561
+ params['areaInSqKm'] = areaInSqKm
2562
+ params['capital'] = capital
2563
+ params['east'] = east
2564
+ params['west'] = west
2565
+ params['north'] = north
2566
+ params['south'] = south
2567
+ params['claimPrice'] = claimPrice
2568
+ params['claimMethods'] = claimMethods
2569
+ return doCurl("post","/country",params)
2570
+ end
2571
+
2572
+
2573
+ #
2574
+ # Fetching a country
2575
+ #
2576
+ # @param country_id
2577
+ # @return - the data from the api
2578
+ #
2579
+ def getCountry( country_id)
2580
+ params = Hash.new
2581
+ params['country_id'] = country_id
2582
+ return doCurl("get","/country",params)
2583
+ end
2584
+
2585
+
2586
+ #
2587
+ # For insance, reporting a phone number as wrong
2588
+ #
2589
+ # @param entity_id - A valid entity_id e.g. 379236608286720
2590
+ # @param gen_id - The gen_id for the item being reported
2591
+ # @param signal_type - The signal that is to be reported e.g. wrong
2592
+ # @param data_type - The type of data being reported
2593
+ # @return - the data from the api
2594
+ #
2595
+ def postSignal( entity_id, gen_id, signal_type, data_type)
2596
+ params = Hash.new
2597
+ params['entity_id'] = entity_id
2598
+ params['gen_id'] = gen_id
2599
+ params['signal_type'] = signal_type
2600
+ params['data_type'] = data_type
2601
+ return doCurl("post","/signal",params)
2602
+ end
2603
+
2604
+
2605
+ #
2606
+ # Get the number of times an entity has been served out as an advert or on serps/bdp pages
2607
+ #
2608
+ # @param entity_id - A valid entity_id e.g. 379236608286720
2609
+ # @param year - The year to report on
2610
+ # @param month - The month to report on
2611
+ # @return - the data from the api
2612
+ #
2613
+ def getStatsEntityBy_date( entity_id, year, month)
2614
+ params = Hash.new
2615
+ params['entity_id'] = entity_id
2616
+ params['year'] = year
2617
+ params['month'] = month
2618
+ return doCurl("get","/stats/entity/by_date",params)
2619
+ end
2620
+
2621
+
2622
+ #
2623
+ # Update/Add a traction
2624
+ #
2625
+ # @param traction_id
2626
+ # @param trigger_type
2627
+ # @param action_type
2628
+ # @param country
2629
+ # @param email_addresses
2630
+ # @param title
2631
+ # @param body
2632
+ # @param api_method
2633
+ # @param api_url
2634
+ # @param api_params
2635
+ # @param active
2636
+ # @return - the data from the api
2637
+ #
2638
+ def postTraction( traction_id, trigger_type, action_type, country, email_addresses, title, body, api_method, api_url, api_params, active)
2639
+ params = Hash.new
2640
+ params['traction_id'] = traction_id
2641
+ params['trigger_type'] = trigger_type
2642
+ params['action_type'] = action_type
2643
+ params['country'] = country
2644
+ params['email_addresses'] = email_addresses
2645
+ params['title'] = title
2646
+ params['body'] = body
2647
+ params['api_method'] = api_method
2648
+ params['api_url'] = api_url
2649
+ params['api_params'] = api_params
2650
+ params['active'] = active
2651
+ return doCurl("post","/traction",params)
2652
+ end
2653
+
2654
+
2655
+ #
2656
+ # Fetching a traction
2657
+ #
2658
+ # @param traction_id
2659
+ # @return - the data from the api
2660
+ #
2661
+ def getTraction( traction_id)
2662
+ params = Hash.new
2663
+ params['traction_id'] = traction_id
2664
+ return doCurl("get","/traction",params)
2665
+ end
2666
+
2667
+
2668
+ #
2669
+ # Fetching active tractions
2670
+ #
2671
+ # @return - the data from the api
2672
+ #
2673
+ def getTractionActive()
2674
+ params = Hash.new
2675
+ return doCurl("get","/traction/active",params)
2676
+ end
2677
+
2678
+
2679
+ #
2680
+ # Deleting a traction
2681
+ #
2682
+ # @param traction_id
2683
+ # @return - the data from the api
2684
+ #
2685
+ def deleteTraction( traction_id)
2686
+ params = Hash.new
2687
+ params['traction_id'] = traction_id
2688
+ return doCurl("delete","/traction",params)
2689
+ end
2690
+
2691
+
2692
+ #
2693
+ # Update/Add a message
2694
+ #
2695
+ # @param message_id - Message id to pull
2696
+ # @param ses_id - Aamazon email id
2697
+ # @param from_user_id - User sending the message
2698
+ # @param from_email - Sent from email address
2699
+ # @param to_entity_id - The id of the entity being sent the message
2700
+ # @param to_email - Sent from email address
2701
+ # @param subject - Subject for the message
2702
+ # @param body - Body for the message
2703
+ # @param bounced - If the message bounced
2704
+ # @return - the data from the api
2705
+ #
2706
+ def postMessage( message_id, ses_id, from_user_id, from_email, to_entity_id, to_email, subject, body, bounced)
2707
+ params = Hash.new
2708
+ params['message_id'] = message_id
2709
+ params['ses_id'] = ses_id
2710
+ params['from_user_id'] = from_user_id
2711
+ params['from_email'] = from_email
2712
+ params['to_entity_id'] = to_entity_id
2713
+ params['to_email'] = to_email
2714
+ params['subject'] = subject
2715
+ params['body'] = body
2716
+ params['bounced'] = bounced
2717
+ return doCurl("post","/message",params)
2718
+ end
2719
+
2720
+
2721
+ #
2722
+ # Fetching a message
2723
+ #
2724
+ # @param message_id - The message id to pull the message for
2725
+ # @return - the data from the api
2726
+ #
2727
+ def getMessage( message_id)
2728
+ params = Hash.new
2729
+ params['message_id'] = message_id
2730
+ return doCurl("get","/message",params)
2731
+ end
2732
+
2733
+
2734
+ #
2735
+ # Fetching messages by ses_id
2736
+ #
2737
+ # @param ses_id - The amazon id to pull the message for
2738
+ # @return - the data from the api
2739
+ #
2740
+ def getMessageBy_ses_id( ses_id)
2741
+ params = Hash.new
2742
+ params['ses_id'] = ses_id
2743
+ return doCurl("get","/message/by_ses_id",params)
2744
+ end
2745
+
2746
+
2747
+ #
2748
+ # Update/Add a flatpack
2749
+ #
2750
+ # @param flatpack_id - this record's unique, auto-generated id - if supplied, then this is an edit, otherwise it's an add
2751
+ # @param domainName - the domain name to serve this flatpack site on (no leading http:// or anything please)
2752
+ # @param flatpackName - the name of the Flat pack instance
2753
+ # @param less - the LESS configuration to use to overrides the Bootstrap CSS
2754
+ # @param language - the language in which to render the flatpack site
2755
+ # @param country - the country to use for searches etc
2756
+ # @param mapsType - the type of maps to use
2757
+ # @param mapKey - the nokia map key to use to render maps
2758
+ # @param analyticsHTML - the html to insert to record page views
2759
+ # @param searchFormShowOn - list of pages to show the search form
2760
+ # @param searchFormShowKeywordsBox - whether to display the keywords box on the search form
2761
+ # @param searchFormShowLocationBox - whether to display the location box on search forms - not required
2762
+ # @param searchFormKeywordsAutoComplete - whether to do auto-completion on the keywords box on the search form
2763
+ # @param searchFormLocationsAutoComplete - whether to do auto-completion on the locations box on the search form
2764
+ # @param searchFormDefaultLocation - the string to use as the default location for searches if no location is supplied
2765
+ # @param searchFormPlaceholderKeywords - the string to show in the keyword box as placeholder text e.g. e.g. cafe
2766
+ # @param searchFormPlaceholderLocation - the string to show in the location box as placeholder text e.g. e.g. Dublin
2767
+ # @param searchFormKeywordsLabel - the string to show next to the keywords control e.g. I'm looking for
2768
+ # @param searchFormLocationLabel - the string to show next to the location control e.g. Located in
2769
+ # @param cannedLinksHeader - the string to show above canned searches
2770
+ # @param homepageTitle - the page title of site's home page
2771
+ # @param homepageDescription - the meta description of the home page
2772
+ # @param homepageIntroTitle - the introductory title for the homepage
2773
+ # @param homepageIntroText - the introductory text for the homepage
2774
+ # @param adblockHeader - the html (JS) to render an advert
2775
+ # @param adblock728x90 - the html (JS) to render a 728x90 advert
2776
+ # @param adblock468x60 - the html (JS) to render a 468x60 advert
2777
+ # @param header_menu - the JSON that describes a navigation at the top of the page
2778
+ # @param footer_menu - the JSON that describes a navigation at the bottom of the page
2779
+ # @param bdpTitle - The page title of the entity business profile pages
2780
+ # @param bdpDescription - The meta description of entity business profile pages
2781
+ # @param bdpAds - The block of HTML/JS that renders Ads on BDPs
2782
+ # @param serpTitle - The page title of the serps
2783
+ # @param serpDescription - The meta description of serps
2784
+ # @param serpNumberResults - The number of results per search page
2785
+ # @param serpNumberAdverts - The number of adverts to show on the first search page
2786
+ # @param serpAds - The block of HTML/JS that renders Ads on Serps
2787
+ # @param cookiePolicyUrl - The cookie policy url of the flatpack
2788
+ # @param cookiePolicyNotice - Whether to show the cookie policy on this flatpack
2789
+ # @param addBusinessButtonText - The text used in the 'Add your business' button
2790
+ # @param twitterUrl - Twitter link
2791
+ # @param facebookUrl - Facebook link
2792
+ # @return - the data from the api
2793
+ #
2794
+ def postFlatpack( flatpack_id, domainName, flatpackName, less, language, country, mapsType, mapKey, analyticsHTML, searchFormShowOn, searchFormShowKeywordsBox, searchFormShowLocationBox, searchFormKeywordsAutoComplete, searchFormLocationsAutoComplete, searchFormDefaultLocation, searchFormPlaceholderKeywords, searchFormPlaceholderLocation, searchFormKeywordsLabel, searchFormLocationLabel, cannedLinksHeader, homepageTitle, homepageDescription, homepageIntroTitle, homepageIntroText, adblockHeader, adblock728x90, adblock468x60, header_menu, footer_menu, bdpTitle, bdpDescription, bdpAds, serpTitle, serpDescription, serpNumberResults, serpNumberAdverts, serpAds, cookiePolicyUrl, cookiePolicyNotice, addBusinessButtonText, twitterUrl, facebookUrl)
2795
+ params = Hash.new
2796
+ params['flatpack_id'] = flatpack_id
2797
+ params['domainName'] = domainName
2798
+ params['flatpackName'] = flatpackName
2799
+ params['less'] = less
2800
+ params['language'] = language
2801
+ params['country'] = country
2802
+ params['mapsType'] = mapsType
2803
+ params['mapKey'] = mapKey
2804
+ params['analyticsHTML'] = analyticsHTML
2805
+ params['searchFormShowOn'] = searchFormShowOn
2806
+ params['searchFormShowKeywordsBox'] = searchFormShowKeywordsBox
2807
+ params['searchFormShowLocationBox'] = searchFormShowLocationBox
2808
+ params['searchFormKeywordsAutoComplete'] = searchFormKeywordsAutoComplete
2809
+ params['searchFormLocationsAutoComplete'] = searchFormLocationsAutoComplete
2810
+ params['searchFormDefaultLocation'] = searchFormDefaultLocation
2811
+ params['searchFormPlaceholderKeywords'] = searchFormPlaceholderKeywords
2812
+ params['searchFormPlaceholderLocation'] = searchFormPlaceholderLocation
2813
+ params['searchFormKeywordsLabel'] = searchFormKeywordsLabel
2814
+ params['searchFormLocationLabel'] = searchFormLocationLabel
2815
+ params['cannedLinksHeader'] = cannedLinksHeader
2816
+ params['homepageTitle'] = homepageTitle
2817
+ params['homepageDescription'] = homepageDescription
2818
+ params['homepageIntroTitle'] = homepageIntroTitle
2819
+ params['homepageIntroText'] = homepageIntroText
2820
+ params['adblockHeader'] = adblockHeader
2821
+ params['adblock728x90'] = adblock728x90
2822
+ params['adblock468x60'] = adblock468x60
2823
+ params['header_menu'] = header_menu
2824
+ params['footer_menu'] = footer_menu
2825
+ params['bdpTitle'] = bdpTitle
2826
+ params['bdpDescription'] = bdpDescription
2827
+ params['bdpAds'] = bdpAds
2828
+ params['serpTitle'] = serpTitle
2829
+ params['serpDescription'] = serpDescription
2830
+ params['serpNumberResults'] = serpNumberResults
2831
+ params['serpNumberAdverts'] = serpNumberAdverts
2832
+ params['serpAds'] = serpAds
2833
+ params['cookiePolicyUrl'] = cookiePolicyUrl
2834
+ params['cookiePolicyNotice'] = cookiePolicyNotice
2835
+ params['addBusinessButtonText'] = addBusinessButtonText
2836
+ params['twitterUrl'] = twitterUrl
2837
+ params['facebookUrl'] = facebookUrl
2838
+ return doCurl("post","/flatpack",params)
2839
+ end
2840
+
2841
+
2842
+ #
2843
+ # Get a flatpack
2844
+ #
2845
+ # @param flatpack_id - the unique id to search for
2846
+ # @return - the data from the api
2847
+ #
2848
+ def getFlatpack( flatpack_id)
2849
+ params = Hash.new
2850
+ params['flatpack_id'] = flatpack_id
2851
+ return doCurl("get","/flatpack",params)
2852
+ end
2853
+
2854
+
2855
+ #
2856
+ # Get a flatpack using a domain name
2857
+ #
2858
+ # @param domainName - the domain name to search for
2859
+ # @return - the data from the api
2860
+ #
2861
+ def getFlatpackBy_domain_name( domainName)
2862
+ params = Hash.new
2863
+ params['domainName'] = domainName
2864
+ return doCurl("get","/flatpack/by_domain_name",params)
2865
+ end
2866
+
2867
+
2868
+ #
2869
+ # Get flatpacks that match the supplied masheryid
2870
+ #
2871
+ # @return - the data from the api
2872
+ #
2873
+ def getFlatpackBy_masheryid()
2874
+ params = Hash.new
2875
+ return doCurl("get","/flatpack/by_masheryid",params)
2876
+ end
2877
+
2878
+
2879
+ #
2880
+ # Remove a flatpack using a supplied flatpack_id
2881
+ #
2882
+ # @param flatpack_id - the id of the flatpack to delete
2883
+ # @return - the data from the api
2884
+ #
2885
+ def deleteFlatpack( flatpack_id)
2886
+ params = Hash.new
2887
+ params['flatpack_id'] = flatpack_id
2888
+ return doCurl("delete","/flatpack",params)
2889
+ end
2890
+
2891
+
2892
+ #
2893
+ # Add a canned link to an existing flatpack site.
2894
+ #
2895
+ # @param flatpack_id - the id of the flatpack to delete
2896
+ # @param keywords - the keywords to use in the canned search
2897
+ # @param location - the location to use in the canned search
2898
+ # @param linkText - the link text to be used to in the canned search link
2899
+ # @return - the data from the api
2900
+ #
2901
+ def postFlatpackLink( flatpack_id, keywords, location, linkText)
2902
+ params = Hash.new
2903
+ params['flatpack_id'] = flatpack_id
2904
+ params['keywords'] = keywords
2905
+ params['location'] = location
2906
+ params['linkText'] = linkText
2907
+ return doCurl("post","/flatpack/link",params)
2908
+ end
2909
+
2910
+
2911
+ #
2912
+ # Remove a canned link to an existing flatpack site.
2913
+ #
2914
+ # @param flatpack_id - the id of the flatpack to delete
2915
+ # @param gen_id - the id of the canned link to remove
2916
+ # @return - the data from the api
2917
+ #
2918
+ def deleteFlatpackLink( flatpack_id, gen_id)
2919
+ params = Hash.new
2920
+ params['flatpack_id'] = flatpack_id
2921
+ params['gen_id'] = gen_id
2922
+ return doCurl("delete","/flatpack/link",params)
2923
+ end
2924
+
2925
+
2926
+ #
2927
+ # Upload a logo to serve out with this flatpack
2928
+ #
2929
+ # @param flatpack_id - the id of the flatpack to update
2930
+ # @param filedata
2931
+ # @return - the data from the api
2932
+ #
2933
+ def postFlatpackLogo( flatpack_id, filedata)
2934
+ params = Hash.new
2935
+ params['flatpack_id'] = flatpack_id
2936
+ params['filedata'] = filedata
2937
+ return doCurl("post","/flatpack/logo",params)
2938
+ end
2939
+
2940
+
2941
+ #
2942
+ # Upload a file to our asset server and return the url
2943
+ #
2944
+ # @param filedata
2945
+ # @return - the data from the api
2946
+ #
2947
+ def postFlatpackUpload( filedata)
2948
+ params = Hash.new
2949
+ params['filedata'] = filedata
2950
+ return doCurl("post","/flatpack/upload",params)
2951
+ end
2952
+
2953
+
2954
+ #
2955
+ # Upload an icon to serve out with this flatpack
2956
+ #
2957
+ # @param flatpack_id - the id of the flatpack to update
2958
+ # @param filedata
2959
+ # @return - the data from the api
2960
+ #
2961
+ def postFlatpackIcon( flatpack_id, filedata)
2962
+ params = Hash.new
2963
+ params['flatpack_id'] = flatpack_id
2964
+ params['filedata'] = filedata
2965
+ return doCurl("post","/flatpack/icon",params)
2966
+ end
2967
+
2968
+
2969
+ #
2970
+ # Allows us to identify the user, entity and element from an encoded endpoint URL's token
2971
+ #
2972
+ # @param token
2973
+ # @return - the data from the api
2974
+ #
2975
+ def getTokenDecode( token)
2976
+ params = Hash.new
2977
+ params['token'] = token
2978
+ return doCurl("get","/token/decode",params)
2979
+ end
2980
+
2981
+
2982
+ #
2983
+ # Provides a tokenised URL to redirect a user so they can add an entity to Central Index
2984
+ #
2985
+ # @param language - The language to use to render the add path e.g. en
2986
+ # @param portal_name - The name of the website that data is to be added on e.g. YourLocal
2987
+ # @return - the data from the api
2988
+ #
2989
+ def getTokenAdd( language, portal_name)
2990
+ params = Hash.new
2991
+ params['language'] = language
2992
+ params['portal_name'] = portal_name
2993
+ return doCurl("get","/token/add",params)
2994
+ end
2995
+
2996
+
2997
+ #
2998
+ # Provides a tokenised URL to redirect a user to claim an entity on Central Index
2999
+ #
3000
+ # @param entity_id - Entity ID to be claimed e.g. 380348266819584
3001
+ # @param language - The language to use to render the claim path e.g. en
3002
+ # @param portal_name - The name of the website that entity is being claimed on e.g. YourLocal
3003
+ # @return - the data from the api
3004
+ #
3005
+ def getTokenClaim( entity_id, language, portal_name)
3006
+ params = Hash.new
3007
+ params['entity_id'] = entity_id
3008
+ params['language'] = language
3009
+ params['portal_name'] = portal_name
3010
+ return doCurl("get","/token/claim",params)
3011
+ end
3012
+
3013
+
3014
+ #
3015
+ # Provides a tokenised URL that allows a user to report incorrect entity information
3016
+ #
3017
+ # @param entity_id - The unique Entity ID e.g. 379236608286720
3018
+ # @param portal_name - The name of the portal that the user is coming from e.g. YourLocal
3019
+ # @param language - The language to use to render the report path
3020
+ # @return - the data from the api
3021
+ #
3022
+ def getTokenReport( entity_id, portal_name, language)
3023
+ params = Hash.new
3024
+ params['entity_id'] = entity_id
3025
+ params['portal_name'] = portal_name
3026
+ params['language'] = language
3027
+ return doCurl("get","/token/report",params)
3028
+ end
3029
+
3030
+
3031
+ #
3032
+ # Fetch token for messaging path
3033
+ #
3034
+ # @param entity_id - The id of the entity being messaged
3035
+ # @param portal_name - The name of the application that has initiated the email process, example: 'Your Local'
3036
+ # @param language - The language for the app
3037
+ # @return - the data from the api
3038
+ #
3039
+ def getTokenMessage( entity_id, portal_name, language)
3040
+ params = Hash.new
3041
+ params['entity_id'] = entity_id
3042
+ params['portal_name'] = portal_name
3043
+ params['language'] = language
3044
+ return doCurl("get","/token/message",params)
3045
+ end
3046
+
3047
+
3048
+ #
3049
+ # Fetch token for login path
3050
+ #
3051
+ # @param portal_name - The name of the application that has initiated the login process, example: 'Your Local'
3052
+ # @param language - The language for the app
3053
+ # @return - the data from the api
3054
+ #
3055
+ def getTokenLogin( portal_name, language)
3056
+ params = Hash.new
3057
+ params['portal_name'] = portal_name
3058
+ params['language'] = language
3059
+ return doCurl("get","/token/login",params)
3060
+ end
3061
+
3062
+
3063
+ #
3064
+ # Send an email via amazon
3065
+ #
3066
+ # @param to_email_address - The email address to send the email too
3067
+ # @param reply_email_address - The email address to add in the reply to field
3068
+ # @param source_account - The source account to send the email from
3069
+ # @param subject - The subject for the email
3070
+ # @param body - The body for the email
3071
+ # @param html_body - If the body of the email is html
3072
+ # @return - the data from the api
3073
+ #
3074
+ def postEmail( to_email_address, reply_email_address, source_account, subject, body, html_body)
3075
+ params = Hash.new
3076
+ params['to_email_address'] = to_email_address
3077
+ params['reply_email_address'] = reply_email_address
3078
+ params['source_account'] = source_account
3079
+ params['subject'] = subject
3080
+ params['body'] = body
3081
+ params['html_body'] = html_body
3082
+ return doCurl("post","/email",params)
3083
+ end
3084
+
3085
+
3086
+ #
3087
+ # Log a sale
3088
+ #
3089
+ # @param entity_id - The entity the sale was made against
3090
+ # @param action_type - The type of action we are performing
3091
+ # @param publisher_id - The publisher id that has made the sale
3092
+ # @param mashery_id - The mashery id
3093
+ # @param reseller_ref - The reference of the sale made by the seller
3094
+ # @param reseller_agent_id - The id of the agent selling the product
3095
+ # @param max_tags - The number of tags available to the entity
3096
+ # @param max_locations - The number of locations available to the entity
3097
+ # @param extra_tags - The extra number of tags
3098
+ # @param extra_locations - The extra number of locations
3099
+ # @param expiry_date - The date the product expires
3100
+ # @return - the data from the api
3101
+ #
3102
+ def postSales_log( entity_id, action_type, publisher_id, mashery_id, reseller_ref, reseller_agent_id, max_tags, max_locations, extra_tags, extra_locations, expiry_date)
3103
+ params = Hash.new
3104
+ params['entity_id'] = entity_id
3105
+ params['action_type'] = action_type
3106
+ params['publisher_id'] = publisher_id
3107
+ params['mashery_id'] = mashery_id
3108
+ params['reseller_ref'] = reseller_ref
3109
+ params['reseller_agent_id'] = reseller_agent_id
3110
+ params['max_tags'] = max_tags
3111
+ params['max_locations'] = max_locations
3112
+ params['extra_tags'] = extra_tags
3113
+ params['extra_locations'] = extra_locations
3114
+ params['expiry_date'] = expiry_date
3115
+ return doCurl("post","/sales_log",params)
3116
+ end
3117
+
3118
+
3119
+ #
3120
+ # Return a sales log by id
3121
+ #
3122
+ # @param sales_log_id - The sales log id to pull
3123
+ # @return - the data from the api
3124
+ #
3125
+ def getSales_log( sales_log_id)
3126
+ params = Hash.new
3127
+ params['sales_log_id'] = sales_log_id
3128
+ return doCurl("get","/sales_log",params)
3129
+ end
3130
+
3131
+
3132
+ #
3133
+ # With a known entity id, a social media object can be added.
3134
+ #
3135
+ # @param entity_id
3136
+ # @param type
3137
+ # @param website_url
3138
+ # @return - the data from the api
3139
+ #
3140
+ def postEntitySocialmedia( entity_id, type, website_url)
3141
+ params = Hash.new
3142
+ params['entity_id'] = entity_id
3143
+ params['type'] = type
3144
+ params['website_url'] = website_url
3145
+ return doCurl("post","/entity/socialmedia",params)
3146
+ end
3147
+
3148
+
3149
+ #
3150
+ # Allows a social media object to be reduced in confidence
3151
+ #
3152
+ # @param entity_id
3153
+ # @param gen_id
3154
+ # @return - the data from the api
3155
+ #
3156
+ def deleteEntitySocialmedia( entity_id, gen_id)
3157
+ params = Hash.new
3158
+ params['entity_id'] = entity_id
3159
+ params['gen_id'] = gen_id
3160
+ return doCurl("delete","/entity/socialmedia",params)
3161
+ end
3162
+
3163
+
3164
+ #
3165
+ # With a known entity id, a private object can be added.
3166
+ #
3167
+ # @param entity_id - The entity to associate the private object with
3168
+ # @param data - The data to store
3169
+ # @return - the data from the api
3170
+ #
3171
+ def putPrivate_object( entity_id, data)
3172
+ params = Hash.new
3173
+ params['entity_id'] = entity_id
3174
+ params['data'] = data
3175
+ return doCurl("put","/private_object",params)
3176
+ end
3177
+
3178
+
3179
+ #
3180
+ # Allows a private object to be removed
3181
+ #
3182
+ # @param private_object_id - The id of the private object to remove
3183
+ # @return - the data from the api
3184
+ #
3185
+ def deletePrivate_object( private_object_id)
3186
+ params = Hash.new
3187
+ params['private_object_id'] = private_object_id
3188
+ return doCurl("delete","/private_object",params)
3189
+ end
3190
+
3191
+
3192
+ #
3193
+ # Allows a private object to be returned based on the entity_id and masheryid
3194
+ #
3195
+ # @param entity_id - The entity associated with the private object
3196
+ # @return - the data from the api
3197
+ #
3198
+ def getPrivate_objectAll( entity_id)
3199
+ params = Hash.new
3200
+ params['entity_id'] = entity_id
3201
+ return doCurl("get","/private_object/all",params)
3202
+ end
3203
+
3204
+
3205
+ #
3206
+ # Update/Add a Group
3207
+ #
3208
+ # @param group_id
3209
+ # @param name
3210
+ # @param description
3211
+ # @param url
3212
+ # @return - the data from the api
3213
+ #
3214
+ def postGroup( group_id, name, description, url)
3215
+ params = Hash.new
3216
+ params['group_id'] = group_id
3217
+ params['name'] = name
3218
+ params['description'] = description
3219
+ params['url'] = url
3220
+ return doCurl("post","/group",params)
3221
+ end
3222
+
3223
+
3224
+ #
3225
+ # Delete a group with a specified group_id
3226
+ #
3227
+ # @param group_id
3228
+ # @return - the data from the api
3229
+ #
3230
+ def deleteGroup( group_id)
3231
+ params = Hash.new
3232
+ params['group_id'] = group_id
3233
+ return doCurl("delete","/group",params)
3234
+ end
3235
+
3236
+
3237
+ #
3238
+ # Returns group that matches a given group id
3239
+ #
3240
+ # @param group_id
3241
+ # @return - the data from the api
3242
+ #
3243
+ def getGroup( group_id)
3244
+ params = Hash.new
3245
+ params['group_id'] = group_id
3246
+ return doCurl("get","/group",params)
3247
+ end
3248
+
3249
+
3250
+ #
3251
+ # With a known entity id, a group can be added to group members.
3252
+ #
3253
+ # @param entity_id
3254
+ # @param group_id
3255
+ # @return - the data from the api
3256
+ #
3257
+ def postEntityGroup( entity_id, group_id)
3258
+ params = Hash.new
3259
+ params['entity_id'] = entity_id
3260
+ params['group_id'] = group_id
3261
+ return doCurl("post","/entity/group",params)
3262
+ end
3263
+
3264
+
3265
+ #
3266
+ # Allows a group object to be removed from an entities group members
3267
+ #
3268
+ # @param entity_id
3269
+ # @param gen_id
3270
+ # @return - the data from the api
3271
+ #
3272
+ def deleteEntityGroup( entity_id, gen_id)
3273
+ params = Hash.new
3274
+ params['entity_id'] = entity_id
3275
+ params['gen_id'] = gen_id
3276
+ return doCurl("delete","/entity/group",params)
3277
+ end
3278
+
3279
+
2128
3280
  end
2129
3281