@addresszen/openapi 4.3.0 → 4.3.1

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.
package/dist/openapi.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "openapi": "3.0.3",
3
3
  "info": {
4
- "version": "4.3.0",
4
+ "version": "4.3.1",
5
5
  "license": {
6
6
  "name": "Copyright (C) IDDQD Limited - All Rights Reserved",
7
7
  "url": "https://terms.addresszen.com"
8
8
  },
9
9
  "title": "API Reference",
10
10
  "termsOfService": "https://terms.addresszen.com",
11
- "description": "## Getting Started\n\nAll API methods are either a `GET`, `POST` or `OPTIONS` request.\n\nThe API communicates over both HTTPS and plain HTTP using IPv4 and IPv6.\n\nWe use appropriate HTTP status codes where possible to indicate the request status. Every error body also carries a numeric `code`. The [error codes guide](https://docs.addresszen.com/docs/guides/error-codes) lists each code and how to fix it.\n\n## OpenAPI Spec\n\nOur OpenAPI specification is available at:\n\n- [npm package](https://www.npmjs.com/package/@addresszen/openapi)\n- [API Reference](https://openapi.addresszen.com)\n- [OpenAPI v3 JSON File](https://openapi.addresszen.com/openapi.json)\n- [OpenAPI v3 YAML File](https://openapi.addresszen.com/openapi.yaml)\n\n## Rate Limiting\n\nEach IP address is rate limited at 30 requests per second. Exceeding the limit returns a 503 response.\n\nThe autocomplete API has an additional rate limit.\n\nIf you expect to exceed the limit, contact us and we can move you to an endpoint with a higher limit.\n\n## Authentication\n\nMost requests need an **API key**. Send it as a Bearer token in the `Authorization` header:\n\n```\ncurl 'https://api.addresszen.com/v1/autocomplete/addresses?q=parkside' \\\n -H 'Authorization: Bearer ak_test'\n```\n\nA header keeps the key out of URLs and server logs.\n\nTwo credentials exist, and they do different jobs:\n\n| Credential | Looks like | Authenticates | Exposure |\n| --- | --- | --- | --- |\n| API Key | `ak_test` | Address, postcode and place lookups. Every billable request | Usable in a browser. Restrict it with allowed URLs |\n| Management Key | `uk_...` | Managing a key under `/keys/{key}`: usage, licensees, configs | Secret. Server side only |\n\nRequests that manage a key, under `/keys/{key}`, take your **Management Key** instead: `Authorization: Bearer uk_...`. The API key is already in the path. The management key was previously called the user token.\n\nTo bill a request to a licensee, send the licensee key as the Bearer token: `Authorization: Bearer sl_...`.\n\nIf you cannot set headers, for example in some browser integrations, pass the key as `api_key` in the query string (or the management key as `user_token`):\n\n```\napi.addresszen.com/v1/autocomplete/addresses?api_key=ak_test&q=parkside\n```\n\nThe query string takes precedence when both are present.\n\nThe older `Authorization: api_key=\"ak_test\"` form still works but is deprecated. Use Bearer in new integrations.\n\n## Versioning\n\nThis API is versioned with a simple prefix in the URL. The current version is `/v1/`. We will maintain backwards-compatibility by releasing breaking changes under a new version.\n\nThe following changes are backwards-compatible:\n\n- Adding new properties to existing API responses\n- Adding new API endpoints\n- Adding new optional request parameters to existing API endpoints\n- Changing the order of properties in existing API responses\n- Changing the autocomplete address suggestion format\n\n## Error Handling\n\nA successful lookup returns an HTTP status code of 200 and a response code of 2000 in the body.\n\nAny other status code means an error. These range from a benign 404 (resource not found) to more urgent problems, such as an API Key out of credit or a failed authentication.\n\n## Testing\n\nTo test the API, create an account. Each new account comes with a free test balance. Contact us if you need more for testing and integration.\n\nThe code samples in this reference use the `ak_test` key. You can use it too, but it is capped at 5 requests per day.\n\n## Metadata\n\nYou can annotate requests that affect your balance with arbitrary metadata. We store it with your lookup history, and you can query it later via the API or the dashboard. We call the ability to label your requests [tagging](https://docs.addresszen.com/docs/guides/tag-and-track).\n\n## Response Codes\n\nThe API returns two indicators to help you determine the status of each HTTP request.\n\nThe first is the **HTTP Status**, which is found in the status line of every HTTP response. The API will return status codes that adhere to HTTP/1.1 Specifications wherever possible.\n\n`2XX` status codes indicate success while `4XX` and `5XX` indicate client and server errors respectively.\n\nThe second is the **API response code**, which can be found in the `code` property of the response body. This code gives a more specific reason for a failure and points you in the right direction when debugging.\n",
11
+ "description": "## Getting Started\n\nAll API methods are either a `GET`, `POST` or `OPTIONS` request.\n\nThe API communicates over both HTTPS and plain HTTP using IPv4 and IPv6.\n\nWe use appropriate HTTP status codes where possible to indicate the request status. Every error body also carries a numeric `code`. The [error codes guide](https://docs.addresszen.com/docs/guides/error-codes) lists each code and how to fix it.\n\n## OpenAPI Spec\n\nOur OpenAPI specification is available at:\n\n- [npm package](https://www.npmjs.com/package/@addresszen/openapi)\n- [API Reference](https://openapi.addresszen.com)\n- [OpenAPI v3 JSON File](https://openapi.addresszen.com/openapi.json)\n- [OpenAPI v3 YAML File](https://openapi.addresszen.com/openapi.yaml)\n\n## Rate Limiting\n\nEach IP address is rate limited at 30 requests per second. Exceeding the limit returns a 503 response.\n\nThe autocomplete API has an additional rate limit.\n\nIf you expect to exceed the limit, contact us and we can move you to an endpoint with a higher limit.\n\n## Authentication\n\nMost requests need an **API key**. Send it as a Bearer token in the `Authorization` header:\n\n```\ncurl 'https://api.addresszen.com/v1/autocomplete/addresses?q=parkside' \\\n -H 'Authorization: Bearer ak_test'\n```\n\nA header keeps the key out of URLs and server logs.\n\nTwo credentials exist, and they do different jobs:\n\n| Credential | Looks like | Authenticates | Exposure |\n| --- | --- | --- | --- |\n| API Key | `ak_test` | Address, postal code and place lookups. Every billable request | Usable in a browser. Restrict it with allowed URLs |\n| Management Key | `uk_...` | Managing a key under `/keys/{key}`: usage, licensees, configs | Secret. Server side only |\n\nRequests that manage a key, under `/keys/{key}`, take your **Management Key** instead: `Authorization: Bearer uk_...`. The API key is already in the path. The management key was previously called the user token.\n\nTo bill a request to a licensee, send the licensee key as the Bearer token: `Authorization: Bearer sl_...`.\n\nIf you cannot set headers, for example in some browser integrations, pass the key as `api_key` in the query string (or the management key as `user_token`):\n\n```\napi.addresszen.com/v1/autocomplete/addresses?api_key=ak_test&q=parkside\n```\n\nThe query string takes precedence when both are present.\n\nThe older `Authorization: api_key=\"ak_test\"` form still works but is deprecated. Use Bearer in new integrations.\n\n## Versioning\n\nThis API is versioned with a simple prefix in the URL. The current version is `/v1/`. We will maintain backwards-compatibility by releasing breaking changes under a new version.\n\nThe following changes are backwards-compatible:\n\n- Adding new properties to existing API responses\n- Adding new API endpoints\n- Adding new optional request parameters to existing API endpoints\n- Changing the order of properties in existing API responses\n- Changing the autocomplete address suggestion format\n\n## Error Handling\n\nA successful lookup returns an HTTP status code of 200 and a response code of 2000 in the body.\n\nAny other status code means an error. These range from a benign 404 (resource not found) to more urgent problems, such as an API Key out of credit or a failed authentication.\n\n## Testing\n\nTo test the API, create an account. Each new account comes with a free test balance. Contact us if you need more for testing and integration.\n\nThe code samples in this reference use the `ak_test` key. You can use it too, but it is capped at 5 requests per day.\n\n## Metadata\n\nYou can annotate requests that affect your balance with arbitrary metadata. We store it with your lookup history, and you can query it later via the API or the dashboard. We call the ability to label your requests [tagging](https://docs.addresszen.com/docs/guides/tag-and-track).\n\n## Response Codes\n\nThe API returns two indicators to help you determine the status of each HTTP request.\n\nThe first is the **HTTP Status**, which is found in the status line of every HTTP response. The API will return status codes that adhere to HTTP/1.1 Specifications wherever possible.\n\n`2XX` status codes indicate success while `4XX` and `5XX` indicate client and server errors respectively.\n\nThe second is the **API response code**, which can be found in the `code` property of the response body. This code gives a more specific reason for a failure and points you in the right direction when debugging.\n",
12
12
  "contact": {
13
13
  "email": "support@addresszen.com",
14
14
  "name": "Support",
@@ -208,12 +208,17 @@
208
208
  {
209
209
  "lang": "Ruby",
210
210
  "label": "Ruby",
211
- "source": "require \"net/http\"\nrequire \"json\"\n\nuri = URI(\"https://api.addresszen.com/v1/keys/ak_test\")\nresult = JSON.parse(Net::HTTP.get(uri))[\"result\"]\n"
211
+ "source": "# gem install addresszen\nrequire \"addresszen\"\n\nclient = AddressZen::Client.new(api_key: \"ak_test\")\nresult = client.key_availability(\"ak_test\").result\n"
212
212
  },
213
213
  {
214
214
  "lang": "PHP",
215
215
  "label": "PHP",
216
216
  "source": "<?php\n$response = file_get_contents(\"https://api.addresszen.com/v1/keys/ak_test\");\n$result = json_decode($response, true)[\"result\"];\n"
217
+ },
218
+ {
219
+ "lang": "Go",
220
+ "label": "Go",
221
+ "source": "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\")\n\tres, err := client.KeyAvailability(context.Background(), \"ak_test\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
217
222
  }
218
223
  ]
219
224
  }
@@ -296,12 +301,17 @@
296
301
  {
297
302
  "lang": "Ruby",
298
303
  "label": "Ruby",
299
- "source": "require \"net/http\"\nrequire \"json\"\n\nuri = URI(\"https://api.addresszen.com/v1/keys/ak_test/details\")\nuri.query = URI.encode_www_form(user_token: \"uk_secret\")\nresult = JSON.parse(Net::HTTP.get(uri))[\"result\"]\n"
304
+ "source": "# gem install addresszen\nrequire \"addresszen\"\n\nclient = AddressZen::Client.new(api_key: \"ak_test\", management_key: \"uk_secret\")\nresult = client.key_details(\"ak_test\").result\n"
300
305
  },
301
306
  {
302
307
  "lang": "PHP",
303
308
  "label": "PHP",
304
309
  "source": "<?php\n$response = file_get_contents(\n \"https://api.addresszen.com/v1/keys/ak_test/details?\" .\n http_build_query([\n \"user_token\" => \"uk_secret\",\n ])\n);\n$result = json_decode($response, true)[\"result\"];\n"
310
+ },
311
+ {
312
+ "lang": "Go",
313
+ "label": "Go",
314
+ "source": "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\", addresszen.WithManagementKey(\"uk_secret\"))\n\tres, err := client.KeyDetails(context.Background(), \"ak_test\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
305
315
  }
306
316
  ]
307
317
  },
@@ -386,12 +396,17 @@
386
396
  {
387
397
  "lang": "Ruby",
388
398
  "label": "Ruby",
389
- "source": "require \"net/http\"\nrequire \"json\"\n\nuri = URI(\"https://api.addresszen.com/v1/keys/ak_test/details?user_token=uk_secret\")\nbody = {\n name: \"My Updated Key\",\n daily_limit: {\n limit: 1000,\n },\n notifications: {\n enabled: true,\n },\n}\nresponse = Net::HTTP.put(uri, body.to_json, \"Content-Type\" => \"application/json\")\nresult = JSON.parse(response.body)[\"result\"]\n"
399
+ "source": "# gem install addresszen\nrequire \"addresszen\"\n\nclient = AddressZen::Client.new(api_key: \"ak_test\", management_key: \"uk_secret\")\nresult = client.update_key_details(\n \"ak_test\",\n name: \"My Updated Key\",\n daily_limit: { limit: 1000 },\n notifications: { enabled: true }\n).result\n"
390
400
  },
391
401
  {
392
402
  "lang": "PHP",
393
403
  "label": "PHP",
394
404
  "source": "<?php\n$ch = curl_init(\"https://api.addresszen.com/v1/keys/ak_test/details?user_token=uk_secret\");\ncurl_setopt_array($ch, [\n CURLOPT_CUSTOMREQUEST => \"PUT\",\n CURLOPT_HTTPHEADER => [\"Content-Type: application/json\"],\n CURLOPT_POSTFIELDS => json_encode([\n \"name\" => \"My Updated Key\",\n \"daily_limit\" => [\n \"limit\" => 1000,\n ],\n \"notifications\" => [\n \"enabled\" => true,\n ],\n ]),\n CURLOPT_RETURNTRANSFER => true,\n]);\n$result = json_decode(curl_exec($ch), true)[\"result\"];\n"
405
+ },
406
+ {
407
+ "lang": "Go",
408
+ "label": "Go",
409
+ "source": "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\", addresszen.WithManagementKey(\"uk_secret\"))\n\tres, err := client.UpdateKeyDetails(context.Background(), \"ak_test\", addresszen.UpdateKeyDetailsBody{\n\t\tName: new(\"My Updated Key\"),\n\t\tDailyLimit: map[string]any{\"limit\": 1000},\n\t\tNotifications: map[string]any{\"enabled\": true},\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
395
410
  }
396
411
  ]
397
412
  }
@@ -475,12 +490,17 @@
475
490
  {
476
491
  "lang": "Ruby",
477
492
  "label": "Ruby",
478
- "source": "require \"net/http\"\nrequire \"json\"\n\nuri = URI(\"https://api.addresszen.com/v1/keys/ak_test/usage\")\nuri.query = URI.encode_www_form(user_token: \"uk_secret\")\nresult = JSON.parse(Net::HTTP.get(uri))[\"result\"]\n"
493
+ "source": "# gem install addresszen\nrequire \"addresszen\"\n\nclient = AddressZen::Client.new(api_key: \"ak_test\", management_key: \"uk_secret\")\nresult = client.key_usage(\"ak_test\").result\n"
479
494
  },
480
495
  {
481
496
  "lang": "PHP",
482
497
  "label": "PHP",
483
498
  "source": "<?php\n$response = file_get_contents(\n \"https://api.addresszen.com/v1/keys/ak_test/usage?\" .\n http_build_query([\n \"user_token\" => \"uk_secret\",\n ])\n);\n$result = json_decode($response, true)[\"result\"];\n"
499
+ },
500
+ {
501
+ "lang": "Go",
502
+ "label": "Go",
503
+ "source": "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\", addresszen.WithManagementKey(\"uk_secret\"))\n\tres, err := client.KeyUsage(context.Background(), \"ak_test\", nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
484
504
  }
485
505
  ]
486
506
  }
@@ -563,12 +583,17 @@
563
583
  {
564
584
  "lang": "Ruby",
565
585
  "label": "Ruby",
566
- "source": "require \"net/http\"\nrequire \"json\"\n\nuri = URI(\"https://api.addresszen.com/v1/keys/ak_test/lookups\")\nuri.query = URI.encode_www_form(user_token: \"uk_secret\")\nresult = JSON.parse(Net::HTTP.get(uri))[\"result\"]\n"
586
+ "source": "# gem install addresszen\nrequire \"addresszen\"\n\nclient = AddressZen::Client.new(api_key: \"ak_test\", management_key: \"uk_secret\")\ncsv = client.key_logs(\"ak_test\")\n"
567
587
  },
568
588
  {
569
589
  "lang": "PHP",
570
590
  "label": "PHP",
571
591
  "source": "<?php\n$response = file_get_contents(\n \"https://api.addresszen.com/v1/keys/ak_test/lookups?\" .\n http_build_query([\n \"user_token\" => \"uk_secret\",\n ])\n);\n$result = json_decode($response, true)[\"result\"];\n"
592
+ },
593
+ {
594
+ "lang": "Go",
595
+ "label": "Go",
596
+ "source": "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\", addresszen.WithManagementKey(\"uk_secret\"))\n\tcsv, err := client.KeyLogs(context.Background(), \"ak_test\", nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Print(csv)\n}\n"
572
597
  }
573
598
  ]
574
599
  }
@@ -682,12 +707,17 @@
682
707
  {
683
708
  "lang": "Ruby",
684
709
  "label": "Ruby",
685
- "source": "require \"net/http\"\nrequire \"json\"\n\nuri = URI(\"https://api.addresszen.com/v1/verify/addresses\")\nbody = {\n query: \"123 Main St, Springfield, IL 62701\",\n}\nresponse = Net::HTTP.post(uri, body.to_json, \"Authorization\" => 'api_key=\"ak_test\"', \"Content-Type\" => \"application/json\")\nresult = JSON.parse(response.body)[\"result\"]\n"
710
+ "source": "# gem install addresszen\nrequire \"addresszen\"\n\nclient = AddressZen::Client.new(api_key: \"ak_test\")\nresult = client.address_verify(query: \"123 Main St, Springfield, IL 62701\").result\n"
686
711
  },
687
712
  {
688
713
  "lang": "PHP",
689
714
  "label": "PHP",
690
715
  "source": "<?php\n$ch = curl_init(\"https://api.addresszen.com/v1/verify/addresses\");\ncurl_setopt_array($ch, [\n CURLOPT_POST => true,\n CURLOPT_HTTPHEADER => ['Authorization: api_key=\"ak_test\"', \"Content-Type: application/json\"],\n CURLOPT_POSTFIELDS => json_encode([\n \"query\" => \"123 Main St, Springfield, IL 62701\",\n ]),\n CURLOPT_RETURNTRANSFER => true,\n]);\n$result = json_decode(curl_exec($ch), true)[\"result\"];\n"
716
+ },
717
+ {
718
+ "lang": "Go",
719
+ "label": "Go",
720
+ "source": "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\")\n\tres, err := client.AddressVerify(context.Background(), addresszen.AddressVerifyBody{\n\t\tQuery: \"123 Main St, Springfield, IL 62701\",\n\t}, nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result.Variant())\n}\n"
691
721
  }
692
722
  ]
693
723
  }
@@ -919,12 +949,17 @@
919
949
  {
920
950
  "lang": "Ruby",
921
951
  "label": "Ruby",
922
- "source": "require \"net/http\"\nrequire \"json\"\n\nuri = URI(\"https://api.addresszen.com/v1/autocomplete/addresses\")\nuri.query = URI.encode_www_form(api_key: \"ak_test\", query: \"1600 Pennsylvania\")\nresult = JSON.parse(Net::HTTP.get(uri))[\"result\"]\n"
952
+ "source": "# gem install addresszen\nrequire \"addresszen\"\n\nclient = AddressZen::Client.new(api_key: \"ak_test\")\nresult = client.find_address(query: \"1600 Pennsylvania\").result\n"
923
953
  },
924
954
  {
925
955
  "lang": "PHP",
926
956
  "label": "PHP",
927
957
  "source": "<?php\n$response = file_get_contents(\n \"https://api.addresszen.com/v1/autocomplete/addresses?\" .\n http_build_query([\n \"api_key\" => \"ak_test\",\n \"query\" => \"1600 Pennsylvania\",\n ])\n);\n$result = json_decode($response, true)[\"result\"];\n"
958
+ },
959
+ {
960
+ "lang": "Go",
961
+ "label": "Go",
962
+ "source": "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\")\n\tres, err := client.FindAddress(context.Background(), &addresszen.FindAddressParams{\n\t\tQuery: \"1600 Pennsylvania\",\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
928
963
  }
929
964
  ]
930
965
  }
@@ -1033,12 +1068,17 @@
1033
1068
  {
1034
1069
  "lang": "Ruby",
1035
1070
  "label": "Ruby",
1036
- "source": "require \"net/http\"\nrequire \"json\"\n\nuri = URI(\"https://api.addresszen.com/v1/autocomplete/addresses/usps_V118834572%7C310%7C%7C3191/usa\")\nuri.query = URI.encode_www_form(api_key: \"ak_test\")\nresult = JSON.parse(Net::HTTP.get(uri))[\"result\"]\n"
1071
+ "source": "# gem install addresszen\nrequire \"addresszen\"\n\nclient = AddressZen::Client.new(api_key: \"ak_test\")\nresult = client.retrieve_address(\"usps_V118834572|310||3191\").result\n"
1037
1072
  },
1038
1073
  {
1039
1074
  "lang": "PHP",
1040
1075
  "label": "PHP",
1041
1076
  "source": "<?php\n$response = file_get_contents(\n \"https://api.addresszen.com/v1/autocomplete/addresses/usps_V118834572%7C310%7C%7C3191/usa?\" .\n http_build_query([\n \"api_key\" => \"ak_test\",\n ])\n);\n$result = json_decode($response, true)[\"result\"];\n"
1077
+ },
1078
+ {
1079
+ "lang": "Go",
1080
+ "label": "Go",
1081
+ "source": "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\")\n\tres, err := client.RetrieveAddress(context.Background(), \"usps_V118834572|310||3191\", nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
1042
1082
  }
1043
1083
  ]
1044
1084
  }
@@ -1183,12 +1223,17 @@
1183
1223
  {
1184
1224
  "lang": "Ruby",
1185
1225
  "label": "Ruby",
1186
- "source": "require \"net/http\"\nrequire \"json\"\n\nuri = URI(\"https://api.addresszen.com/v1/places\")\nuri.query = URI.encode_www_form(api_key: \"ak_test\", query: \"london\")\nresult = JSON.parse(Net::HTTP.get(uri))[\"result\"]\n"
1226
+ "source": "# gem install addresszen\nrequire \"addresszen\"\n\nclient = AddressZen::Client.new(api_key: \"ak_test\")\nresult = client.find_place(query: \"london\").result\n"
1187
1227
  },
1188
1228
  {
1189
1229
  "lang": "PHP",
1190
1230
  "label": "PHP",
1191
1231
  "source": "<?php\n$response = file_get_contents(\n \"https://api.addresszen.com/v1/places?\" .\n http_build_query([\n \"api_key\" => \"ak_test\",\n \"query\" => \"london\",\n ])\n);\n$result = json_decode($response, true)[\"result\"];\n"
1232
+ },
1233
+ {
1234
+ "lang": "Go",
1235
+ "label": "Go",
1236
+ "source": "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\")\n\tres, err := client.FindPlace(context.Background(), &addresszen.FindPlaceParams{\n\t\tQuery: \"london\",\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfor _, hit := range res.Result.Hits {\n\t\tfmt.Printf(\"%+v\\n\", hit.Variant())\n\t}\n}\n"
1192
1237
  }
1193
1238
  ]
1194
1239
  }
@@ -1439,12 +1484,17 @@
1439
1484
  {
1440
1485
  "lang": "Ruby",
1441
1486
  "label": "Ruby",
1442
- "source": "require \"net/http\"\nrequire \"json\"\n\nuri = URI(\"https://api.addresszen.com/v1/places/geonames_2643743\")\nuri.query = URI.encode_www_form(api_key: \"ak_test\")\nresult = JSON.parse(Net::HTTP.get(uri))[\"result\"]\n"
1487
+ "source": "# gem install addresszen\nrequire \"addresszen\"\n\nclient = AddressZen::Client.new(api_key: \"ak_test\")\nresult = client.resolve_place(\"geonames_2643743\").result\n"
1443
1488
  },
1444
1489
  {
1445
1490
  "lang": "PHP",
1446
1491
  "label": "PHP",
1447
1492
  "source": "<?php\n$response = file_get_contents(\n \"https://api.addresszen.com/v1/places/geonames_2643743?\" .\n http_build_query([\n \"api_key\" => \"ak_test\",\n ])\n);\n$result = json_decode($response, true)[\"result\"];\n"
1493
+ },
1494
+ {
1495
+ "lang": "Go",
1496
+ "label": "Go",
1497
+ "source": "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\")\n\tres, err := client.ResolvePlace(context.Background(), \"geonames_2643743\", nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
1448
1498
  }
1449
1499
  ]
1450
1500
  }
@@ -1455,7 +1505,7 @@
1455
1505
  "Licensees"
1456
1506
  ],
1457
1507
  "summary": "List",
1458
- "description": "Returns a key's licensees, oldest first, up to 100 per request. The list omits canceled licensees. The key must be enabled for sub-licensing.",
1508
+ "description": "Returns a key's licensees, oldest first, up to 100 per request. The list omits canceled licensees. The key must be enabled for sublicensing.",
1459
1509
  "operationId": "ListLicensees",
1460
1510
  "security": [
1461
1511
  {
@@ -1539,12 +1589,17 @@
1539
1589
  {
1540
1590
  "lang": "Ruby",
1541
1591
  "label": "Ruby",
1542
- "source": "require \"net/http\"\nrequire \"json\"\n\nuri = URI(\"https://api.addresszen.com/v1/keys/ak_test/licensees\")\nuri.query = URI.encode_www_form(user_token: \"uk_secret\")\nresult = JSON.parse(Net::HTTP.get(uri))[\"result\"]\n"
1592
+ "source": "# gem install addresszen\nrequire \"addresszen\"\n\nclient = AddressZen::Client.new(api_key: \"ak_test\", management_key: \"uk_secret\")\nresult = client.list_licensees(\"ak_test\").result\n"
1543
1593
  },
1544
1594
  {
1545
1595
  "lang": "PHP",
1546
1596
  "label": "PHP",
1547
1597
  "source": "<?php\n$response = file_get_contents(\n \"https://api.addresszen.com/v1/keys/ak_test/licensees?\" .\n http_build_query([\n \"user_token\" => \"uk_secret\",\n ])\n);\n$result = json_decode($response, true)[\"result\"];\n"
1598
+ },
1599
+ {
1600
+ "lang": "Go",
1601
+ "label": "Go",
1602
+ "source": "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\", addresszen.WithManagementKey(\"uk_secret\"))\n\tres, err := client.ListLicensees(context.Background(), \"ak_test\", nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
1548
1603
  }
1549
1604
  ]
1550
1605
  },
@@ -1553,7 +1608,7 @@
1553
1608
  "Licensees"
1554
1609
  ],
1555
1610
  "summary": "Create",
1556
- "description": "Creates a licensee on a key and returns it with its generated `sl_` key. The key must be enabled for sub-licensing.",
1611
+ "description": "Creates a licensee on a key and returns it with its generated `sl_` key. The key must be enabled for sublicensing.",
1557
1612
  "operationId": "CreateLicensee",
1558
1613
  "security": [
1559
1614
  {
@@ -1604,27 +1659,32 @@
1604
1659
  {
1605
1660
  "lang": "cURL",
1606
1661
  "label": "curl",
1607
- "source": "curl -X POST 'https://api.addresszen.com/v1/keys/ak_test/licensees?user_token=uk_secret' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"name\": \"Qwerty Widgets Limited\",\n \"address\": \"12 High Street, Manchester\",\n \"postcode\": \"BR8 7RE\",\n \"whitelist\": [],\n \"daily\": {\n \"limit\": 10000\n }\n }'\n"
1662
+ "source": "curl -X POST 'https://api.addresszen.com/v1/keys/ak_test/licensees?user_token=uk_secret' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"name\": \"Acme Inc\",\n \"address\": \"1010 Cauthen Ln, Alamogordo, NM\",\n \"postcode\": \"88310\",\n \"whitelist\": [],\n \"daily\": {\n \"limit\": 10000\n }\n }'\n"
1608
1663
  },
1609
1664
  {
1610
1665
  "lang": "JavaScript",
1611
1666
  "label": "JavaScript",
1612
- "source": "import { createZenClient, createLicensee } from '@addresszen/sdk';\n\nconst client = createZenClient({ apiKey: 'ak_test', userToken: 'uk_secret' });\n\nconst { data } = await createLicensee({\n client,\n path: { key: 'ak_test' },\n body: {\n name: 'Qwerty Widgets Limited',\n address: '12 High Street, Manchester',\n postcode: 'BR8 7RE',\n whitelist: [],\n daily: {\n limit: 10000,\n },\n },\n});\n"
1667
+ "source": "import { createZenClient, createLicensee } from '@addresszen/sdk';\n\nconst client = createZenClient({ apiKey: 'ak_test', userToken: 'uk_secret' });\n\nconst { data } = await createLicensee({\n client,\n path: { key: 'ak_test' },\n body: {\n name: 'Acme Inc',\n address: '1010 Cauthen Ln, Alamogordo, NM',\n postcode: '88310',\n whitelist: [],\n daily: {\n limit: 10000,\n },\n },\n});\n"
1613
1668
  },
1614
1669
  {
1615
1670
  "lang": "Python",
1616
1671
  "label": "Python",
1617
- "source": "# pip install addresszen\nfrom addresszen import AddressZen\n\nwith AddressZen(\"ak_test\") as client:\n result = client.create_licensee(\n \"ak_test\",\n user_token=\"uk_secret\",\n name=\"Qwerty Widgets Limited\",\n address=\"12 High Street, Manchester\",\n postcode=\"BR8 7RE\",\n whitelist=[],\n daily={\"limit\": 10000},\n )\n"
1672
+ "source": "# pip install addresszen\nfrom addresszen import AddressZen\n\nwith AddressZen(\"ak_test\") as client:\n result = client.create_licensee(\n \"ak_test\",\n user_token=\"uk_secret\",\n name=\"Acme Inc\",\n address=\"1010 Cauthen Ln, Alamogordo, NM\",\n postcode=\"88310\",\n whitelist=[],\n daily={\"limit\": 10000},\n )\n"
1618
1673
  },
1619
1674
  {
1620
1675
  "lang": "Ruby",
1621
1676
  "label": "Ruby",
1622
- "source": "require \"net/http\"\nrequire \"json\"\n\nuri = URI(\"https://api.addresszen.com/v1/keys/ak_test/licensees?user_token=uk_secret\")\nbody = {\n name: \"Qwerty Widgets Limited\",\n address: \"12 High Street, Manchester\",\n postcode: \"BR8 7RE\",\n whitelist: [],\n daily: {\n limit: 10000,\n },\n}\nresponse = Net::HTTP.post(uri, body.to_json, \"Content-Type\" => \"application/json\")\nresult = JSON.parse(response.body)[\"result\"]\n"
1677
+ "source": "# gem install addresszen\nrequire \"addresszen\"\n\nclient = AddressZen::Client.new(api_key: \"ak_test\", management_key: \"uk_secret\")\nresult = client.create_licensee(\n \"ak_test\",\n name: \"Acme Inc\",\n address: \"1010 Cauthen Ln, Alamogordo, NM\",\n postcode: \"88310\",\n whitelist: [],\n daily: { limit: 10000 }\n).result\n"
1623
1678
  },
1624
1679
  {
1625
1680
  "lang": "PHP",
1626
1681
  "label": "PHP",
1627
- "source": "<?php\n$ch = curl_init(\"https://api.addresszen.com/v1/keys/ak_test/licensees?user_token=uk_secret\");\ncurl_setopt_array($ch, [\n CURLOPT_POST => true,\n CURLOPT_HTTPHEADER => [\"Content-Type: application/json\"],\n CURLOPT_POSTFIELDS => json_encode([\n \"name\" => \"Qwerty Widgets Limited\",\n \"address\" => \"12 High Street, Manchester\",\n \"postcode\" => \"BR8 7RE\",\n \"whitelist\" => [],\n \"daily\" => [\n \"limit\" => 10000,\n ],\n ]),\n CURLOPT_RETURNTRANSFER => true,\n]);\n$result = json_decode(curl_exec($ch), true)[\"result\"];\n"
1682
+ "source": "<?php\n$ch = curl_init(\"https://api.addresszen.com/v1/keys/ak_test/licensees?user_token=uk_secret\");\ncurl_setopt_array($ch, [\n CURLOPT_POST => true,\n CURLOPT_HTTPHEADER => [\"Content-Type: application/json\"],\n CURLOPT_POSTFIELDS => json_encode([\n \"name\" => \"Acme Inc\",\n \"address\" => \"1010 Cauthen Ln, Alamogordo, NM\",\n \"postcode\" => \"88310\",\n \"whitelist\" => [],\n \"daily\" => [\n \"limit\" => 10000,\n ],\n ]),\n CURLOPT_RETURNTRANSFER => true,\n]);\n$result = json_decode(curl_exec($ch), true)[\"result\"];\n"
1683
+ },
1684
+ {
1685
+ "lang": "Go",
1686
+ "label": "Go",
1687
+ "source": "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\", addresszen.WithManagementKey(\"uk_secret\"))\n\tres, err := client.CreateLicensee(context.Background(), \"ak_test\", addresszen.CreateLicenseeBody{\n\t\tName: new(\"Acme Inc\"),\n\t\tAddress: new(\"1010 Cauthen Ln, Alamogordo, NM\"),\n\t\tPostcode: new(\"88310\"),\n\t\tWhitelist: new([]string{}),\n\t\tDaily: map[string]any{\"limit\": 10000},\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
1628
1688
  }
1629
1689
  ]
1630
1690
  }
@@ -1700,12 +1760,17 @@
1700
1760
  {
1701
1761
  "lang": "Ruby",
1702
1762
  "label": "Ruby",
1703
- "source": "require \"net/http\"\nrequire \"json\"\n\nuri = URI(\"https://api.addresszen.com/v1/keys/ak_test/licensees/sl_ijoiqsxeQgXW2gkiE0X94\")\nuri.query = URI.encode_www_form(user_token: \"uk_secret\")\nresult = JSON.parse(Net::HTTP.get(uri))[\"result\"]\n"
1763
+ "source": "# gem install addresszen\nrequire \"addresszen\"\n\nclient = AddressZen::Client.new(api_key: \"ak_test\", management_key: \"uk_secret\")\nresult = client.retrieve_licensee(\"ak_test\", \"sl_ijoiqsxeQgXW2gkiE0X94\").result\n"
1704
1764
  },
1705
1765
  {
1706
1766
  "lang": "PHP",
1707
1767
  "label": "PHP",
1708
1768
  "source": "<?php\n$response = file_get_contents(\n \"https://api.addresszen.com/v1/keys/ak_test/licensees/sl_ijoiqsxeQgXW2gkiE0X94?\" .\n http_build_query([\n \"user_token\" => \"uk_secret\",\n ])\n);\n$result = json_decode($response, true)[\"result\"];\n"
1769
+ },
1770
+ {
1771
+ "lang": "Go",
1772
+ "label": "Go",
1773
+ "source": "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\", addresszen.WithManagementKey(\"uk_secret\"))\n\tres, err := client.RetrieveLicensee(context.Background(), \"ak_test\", \"sl_ijoiqsxeQgXW2gkiE0X94\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
1709
1774
  }
1710
1775
  ]
1711
1776
  },
@@ -1808,12 +1873,17 @@
1808
1873
  {
1809
1874
  "lang": "Ruby",
1810
1875
  "label": "Ruby",
1811
- "source": "require \"net/http\"\n\nuri = URI(\"https://api.addresszen.com/v1/keys/ak_test/licensees/sl_ijoiqsxeQgXW2gkiE0X94?user_token=uk_secret\")\nNet::HTTP.start(uri.host, use_ssl: true) do |http|\n http.delete(uri.request_uri)\nend\n"
1876
+ "source": "# gem install addresszen\nrequire \"addresszen\"\n\nclient = AddressZen::Client.new(api_key: \"ak_test\", management_key: \"uk_secret\")\nresult = client.delete_licensee(\"ak_test\", \"sl_ijoiqsxeQgXW2gkiE0X94\").result\n"
1812
1877
  },
1813
1878
  {
1814
1879
  "lang": "PHP",
1815
1880
  "label": "PHP",
1816
1881
  "source": "<?php\n$ch = curl_init(\"https://api.addresszen.com/v1/keys/ak_test/licensees/sl_ijoiqsxeQgXW2gkiE0X94?user_token=uk_secret\");\ncurl_setopt_array($ch, [\n CURLOPT_CUSTOMREQUEST => \"DELETE\",\n CURLOPT_RETURNTRANSFER => true,\n]);\ncurl_exec($ch);\n"
1882
+ },
1883
+ {
1884
+ "lang": "Go",
1885
+ "label": "Go",
1886
+ "source": "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\", addresszen.WithManagementKey(\"uk_secret\"))\n\tres, err := client.DeleteLicensee(context.Background(), \"ak_test\", \"sl_ijoiqsxeQgXW2gkiE0X94\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
1817
1887
  }
1818
1888
  ]
1819
1889
  },
@@ -1891,12 +1961,17 @@
1891
1961
  {
1892
1962
  "lang": "Ruby",
1893
1963
  "label": "Ruby",
1894
- "source": "require \"net/http\"\nrequire \"json\"\n\nuri = URI(\"https://api.addresszen.com/v1/keys/ak_test/licensees/sl_ijoiqsxeQgXW2gkiE0X94?user_token=uk_secret\")\nbody = {\n daily: {\n limit: 20000,\n },\n}\nresponse = Net::HTTP.post(uri, body.to_json, \"Content-Type\" => \"application/json\")\nresult = JSON.parse(response.body)[\"result\"]\n"
1964
+ "source": "# gem install addresszen\nrequire \"addresszen\"\n\nclient = AddressZen::Client.new(api_key: \"ak_test\", management_key: \"uk_secret\")\nresult = client.update_licensee(\"ak_test\", \"sl_ijoiqsxeQgXW2gkiE0X94\", daily: { limit: 20000 }).result\n"
1895
1965
  },
1896
1966
  {
1897
1967
  "lang": "PHP",
1898
1968
  "label": "PHP",
1899
1969
  "source": "<?php\n$ch = curl_init(\"https://api.addresszen.com/v1/keys/ak_test/licensees/sl_ijoiqsxeQgXW2gkiE0X94?user_token=uk_secret\");\ncurl_setopt_array($ch, [\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_HTTPHEADER => [\"Content-Type: application/json\"],\n CURLOPT_POSTFIELDS => json_encode([\n \"daily\" => [\n \"limit\" => 20000,\n ],\n ]),\n CURLOPT_RETURNTRANSFER => true,\n]);\n$result = json_decode(curl_exec($ch), true)[\"result\"];\n"
1970
+ },
1971
+ {
1972
+ "lang": "Go",
1973
+ "label": "Go",
1974
+ "source": "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\", addresszen.WithManagementKey(\"uk_secret\"))\n\tres, err := client.UpdateLicensee(context.Background(), \"ak_test\", \"sl_ijoiqsxeQgXW2gkiE0X94\", addresszen.UpdateLicenseeBody{\n\t\tDaily: map[string]any{\"limit\": 20000},\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
1900
1975
  }
1901
1976
  ]
1902
1977
  }
@@ -1966,12 +2041,17 @@
1966
2041
  {
1967
2042
  "lang": "Ruby",
1968
2043
  "label": "Ruby",
1969
- "source": "require \"net/http\"\nrequire \"json\"\n\nuri = URI(\"https://api.addresszen.com/v1/keys/ak_test/licensees/sl_ijoiqsxeQgXW2gkiE0X94/regenerate-key?user_token=uk_secret\")\nresponse = Net::HTTP.post(uri, \"\")\nresult = JSON.parse(response.body)[\"result\"]\n"
2044
+ "source": "# gem install addresszen\nrequire \"addresszen\"\n\nclient = AddressZen::Client.new(api_key: \"ak_test\", management_key: \"uk_secret\")\nresult = client.regenerate_licensee_key(\"ak_test\", \"sl_ijoiqsxeQgXW2gkiE0X94\").result\n"
1970
2045
  },
1971
2046
  {
1972
2047
  "lang": "PHP",
1973
2048
  "label": "PHP",
1974
2049
  "source": "<?php\n$ch = curl_init(\"https://api.addresszen.com/v1/keys/ak_test/licensees/sl_ijoiqsxeQgXW2gkiE0X94/regenerate-key?user_token=uk_secret\");\ncurl_setopt_array($ch, [\n CURLOPT_POST => true,\n CURLOPT_RETURNTRANSFER => true,\n]);\n$result = json_decode(curl_exec($ch), true)[\"result\"];\n"
2050
+ },
2051
+ {
2052
+ "lang": "Go",
2053
+ "label": "Go",
2054
+ "source": "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\", addresszen.WithManagementKey(\"uk_secret\"))\n\tres, err := client.RegenerateLicenseeKey(context.Background(), \"ak_test\", \"sl_ijoiqsxeQgXW2gkiE0X94\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
1975
2055
  }
1976
2056
  ]
1977
2057
  }
@@ -2043,12 +2123,17 @@
2043
2123
  {
2044
2124
  "lang": "Ruby",
2045
2125
  "label": "Ruby",
2046
- "source": "require \"net/http\"\nrequire \"json\"\n\nuri = URI(\"https://api.addresszen.com/v1/keys/ak_test/configs\")\nuri.query = URI.encode_www_form(user_token: \"uk_secret\")\nresult = JSON.parse(Net::HTTP.get(uri))[\"result\"]\n"
2126
+ "source": "# gem install addresszen\nrequire \"addresszen\"\n\nclient = AddressZen::Client.new(api_key: \"ak_test\", management_key: \"uk_secret\")\nresult = client.list_configs(\"ak_test\").result\n"
2047
2127
  },
2048
2128
  {
2049
2129
  "lang": "PHP",
2050
2130
  "label": "PHP",
2051
2131
  "source": "<?php\n$response = file_get_contents(\n \"https://api.addresszen.com/v1/keys/ak_test/configs?\" .\n http_build_query([\n \"user_token\" => \"uk_secret\",\n ])\n);\n$result = json_decode($response, true)[\"result\"];\n"
2132
+ },
2133
+ {
2134
+ "lang": "Go",
2135
+ "label": "Go",
2136
+ "source": "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\", addresszen.WithManagementKey(\"uk_secret\"))\n\tres, err := client.ListConfigs(context.Background(), \"ak_test\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
2052
2137
  }
2053
2138
  ]
2054
2139
  },
@@ -2123,12 +2208,17 @@
2123
2208
  {
2124
2209
  "lang": "Ruby",
2125
2210
  "label": "Ruby",
2126
- "source": "require \"net/http\"\nrequire \"json\"\n\nuri = URI(\"https://api.addresszen.com/v1/keys/ak_test/configs?user_token=uk_secret\")\nbody = {\n name: \"woocommerce\",\n payload: '{\"removeOrganisation\": false}',\n}\nresponse = Net::HTTP.post(uri, body.to_json, \"Content-Type\" => \"application/json\")\nresult = JSON.parse(response.body)[\"result\"]\n"
2211
+ "source": "# gem install addresszen\nrequire \"addresszen\"\n\nclient = AddressZen::Client.new(api_key: \"ak_test\", management_key: \"uk_secret\")\nresult = client.create_config(\n \"ak_test\",\n name: \"woocommerce\",\n payload: '{\"removeOrganisation\": false}'\n).result\n"
2127
2212
  },
2128
2213
  {
2129
2214
  "lang": "PHP",
2130
2215
  "label": "PHP",
2131
2216
  "source": "<?php\n$ch = curl_init(\"https://api.addresszen.com/v1/keys/ak_test/configs?user_token=uk_secret\");\ncurl_setopt_array($ch, [\n CURLOPT_POST => true,\n CURLOPT_HTTPHEADER => [\"Content-Type: application/json\"],\n CURLOPT_POSTFIELDS => json_encode([\n \"name\" => \"woocommerce\",\n \"payload\" => '{\"removeOrganisation\": false}',\n ]),\n CURLOPT_RETURNTRANSFER => true,\n]);\n$result = json_decode(curl_exec($ch), true)[\"result\"];\n"
2217
+ },
2218
+ {
2219
+ "lang": "Go",
2220
+ "label": "Go",
2221
+ "source": "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\", addresszen.WithManagementKey(\"uk_secret\"))\n\tres, err := client.CreateConfig(context.Background(), \"ak_test\", addresszen.CreateConfigBody{\n\t\tName: \"woocommerce\",\n\t\tPayload: `{\"removeOrganisation\": false}`,\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
2132
2222
  }
2133
2223
  ]
2134
2224
  }
@@ -2206,12 +2296,17 @@
2206
2296
  {
2207
2297
  "lang": "Ruby",
2208
2298
  "label": "Ruby",
2209
- "source": "require \"net/http\"\nrequire \"json\"\n\nuri = URI(\"https://api.addresszen.com/v1/keys/ak_test/configs/woocommerce\")\nuri.query = URI.encode_www_form(user_token: \"uk_secret\")\nresult = JSON.parse(Net::HTTP.get(uri))[\"result\"]\n"
2299
+ "source": "# gem install addresszen\nrequire \"addresszen\"\n\nclient = AddressZen::Client.new(api_key: \"ak_test\")\nresult = client.retrieve_config(\"ak_test\", \"woocommerce\").result\n"
2210
2300
  },
2211
2301
  {
2212
2302
  "lang": "PHP",
2213
2303
  "label": "PHP",
2214
2304
  "source": "<?php\n$response = file_get_contents(\n \"https://api.addresszen.com/v1/keys/ak_test/configs/woocommerce?\" .\n http_build_query([\n \"user_token\" => \"uk_secret\",\n ])\n);\n$result = json_decode($response, true)[\"result\"];\n"
2305
+ },
2306
+ {
2307
+ "lang": "Go",
2308
+ "label": "Go",
2309
+ "source": "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\")\n\tres, err := client.RetrieveConfig(context.Background(), \"ak_test\", \"woocommerce\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
2215
2310
  }
2216
2311
  ]
2217
2312
  },
@@ -2324,12 +2419,17 @@
2324
2419
  {
2325
2420
  "lang": "Ruby",
2326
2421
  "label": "Ruby",
2327
- "source": "require \"net/http\"\n\nuri = URI(\"https://api.addresszen.com/v1/keys/ak_test/configs/woocommerce?user_token=uk_secret\")\nNet::HTTP.start(uri.host, use_ssl: true) do |http|\n http.delete(uri.request_uri)\nend\n"
2422
+ "source": "# gem install addresszen\nrequire \"addresszen\"\n\nclient = AddressZen::Client.new(api_key: \"ak_test\", management_key: \"uk_secret\")\nresult = client.delete_config(\"ak_test\", \"woocommerce\").result\n"
2328
2423
  },
2329
2424
  {
2330
2425
  "lang": "PHP",
2331
2426
  "label": "PHP",
2332
2427
  "source": "<?php\n$ch = curl_init(\"https://api.addresszen.com/v1/keys/ak_test/configs/woocommerce?user_token=uk_secret\");\ncurl_setopt_array($ch, [\n CURLOPT_CUSTOMREQUEST => \"DELETE\",\n CURLOPT_RETURNTRANSFER => true,\n]);\ncurl_exec($ch);\n"
2428
+ },
2429
+ {
2430
+ "lang": "Go",
2431
+ "label": "Go",
2432
+ "source": "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\", addresszen.WithManagementKey(\"uk_secret\"))\n\tres, err := client.DeleteConfig(context.Background(), \"ak_test\", \"woocommerce\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
2333
2433
  }
2334
2434
  ]
2335
2435
  },
@@ -2417,12 +2517,17 @@
2417
2517
  {
2418
2518
  "lang": "Ruby",
2419
2519
  "label": "Ruby",
2420
- "source": "require \"net/http\"\nrequire \"json\"\n\nuri = URI(\"https://api.addresszen.com/v1/keys/ak_test/configs/woocommerce?user_token=uk_secret\")\nbody = {\n payload: '{\"removeOrganisation\": true}',\n}\nresponse = Net::HTTP.post(uri, body.to_json, \"Content-Type\" => \"application/json\")\nresult = JSON.parse(response.body)[\"result\"]\n"
2520
+ "source": "# gem install addresszen\nrequire \"addresszen\"\n\nclient = AddressZen::Client.new(api_key: \"ak_test\", management_key: \"uk_secret\")\nresult = client.update_config(\"ak_test\", \"woocommerce\", payload: '{\"removeOrganisation\": true}').result\n"
2421
2521
  },
2422
2522
  {
2423
2523
  "lang": "PHP",
2424
2524
  "label": "PHP",
2425
2525
  "source": "<?php\n$ch = curl_init(\"https://api.addresszen.com/v1/keys/ak_test/configs/woocommerce?user_token=uk_secret\");\ncurl_setopt_array($ch, [\n CURLOPT_POST => true,\n CURLOPT_HTTPHEADER => [\"Content-Type: application/json\"],\n CURLOPT_POSTFIELDS => json_encode([\n \"payload\" => '{\"removeOrganisation\": true}',\n ]),\n CURLOPT_RETURNTRANSFER => true,\n]);\n$result = json_decode(curl_exec($ch), true)[\"result\"];\n"
2526
+ },
2527
+ {
2528
+ "lang": "Go",
2529
+ "label": "Go",
2530
+ "source": "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\", addresszen.WithManagementKey(\"uk_secret\"))\n\tres, err := client.UpdateConfig(context.Background(), \"ak_test\", \"woocommerce\", addresszen.UpdateConfigBody{\n\t\tPayload: new(`{\"removeOrganisation\": true}`),\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result)\n}\n"
2426
2531
  }
2427
2532
  ]
2428
2533
  }
@@ -2523,12 +2628,17 @@
2523
2628
  {
2524
2629
  "lang": "Ruby",
2525
2630
  "label": "Ruby",
2526
- "source": "require \"net/http\"\nrequire \"json\"\n\nuri = URI(\"https://api.addresszen.com/v1/emails\")\nuri.query = URI.encode_www_form(api_key: \"ak_test\", query: \"foo@domain.com\")\nresult = JSON.parse(Net::HTTP.get(uri))[\"result\"]\n"
2631
+ "source": "# gem install addresszen\nrequire \"addresszen\"\n\nclient = AddressZen::Client.new(api_key: \"ak_test\")\nresult = client.email_validation(query: \"foo@domain.com\").result\n"
2527
2632
  },
2528
2633
  {
2529
2634
  "lang": "PHP",
2530
2635
  "label": "PHP",
2531
2636
  "source": "<?php\n$response = file_get_contents(\n \"https://api.addresszen.com/v1/emails?\" .\n http_build_query([\n \"api_key\" => \"ak_test\",\n \"query\" => \"foo@domain.com\",\n ])\n);\n$result = json_decode($response, true)[\"result\"];\n"
2637
+ },
2638
+ {
2639
+ "lang": "Go",
2640
+ "label": "Go",
2641
+ "source": "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\")\n\tres, err := client.EmailValidation(context.Background(), \"foo@domain.com\", nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result.Variant())\n}\n"
2532
2642
  }
2533
2643
  ]
2534
2644
  }
@@ -2654,12 +2764,17 @@
2654
2764
  {
2655
2765
  "lang": "Ruby",
2656
2766
  "label": "Ruby",
2657
- "source": "require \"net/http\"\nrequire \"json\"\n\nuri = URI(\"https://api.addresszen.com/v1/phone_numbers\")\nuri.query = URI.encode_www_form(api_key: \"ak_test\", query: \"02071128019\")\nresult = JSON.parse(Net::HTTP.get(uri))[\"result\"]\n"
2767
+ "source": "# gem install addresszen\nrequire \"addresszen\"\n\nclient = AddressZen::Client.new(api_key: \"ak_test\")\nresult = client.phone_number_validation(query: \"02071128019\").result\n"
2658
2768
  },
2659
2769
  {
2660
2770
  "lang": "PHP",
2661
2771
  "label": "PHP",
2662
2772
  "source": "<?php\n$response = file_get_contents(\n \"https://api.addresszen.com/v1/phone_numbers?\" .\n http_build_query([\n \"api_key\" => \"ak_test\",\n \"query\" => \"02071128019\",\n ])\n);\n$result = json_decode($response, true)[\"result\"];\n"
2773
+ },
2774
+ {
2775
+ "lang": "Go",
2776
+ "label": "Go",
2777
+ "source": "// go get go.addresszen.com/sdk\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\taddresszen \"go.addresszen.com/sdk\"\n)\n\nfunc main() {\n\tclient := addresszen.NewClient(\"ak_test\")\n\tres, err := client.PhoneNumberValidation(context.Background(), \"02071128019\", nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", res.Result.Variant())\n}\n"
2663
2778
  }
2664
2779
  ]
2665
2780
  }
@@ -2812,6 +2927,11 @@
2812
2927
  "lang": "PHP",
2813
2928
  "label": "PHP",
2814
2929
  "source": "<?php\n$ch = curl_init(\"https://api.addresszen.com/v1/sign_up\");\ncurl_setopt_array($ch, [\n CURLOPT_POST => true,\n CURLOPT_HTTPHEADER => [\"Content-Type: application/json\"],\n CURLOPT_POSTFIELDS => json_encode([\n \"email\" => \"user@example.com\",\n \"name\" => \"Jane Smith\",\n \"org_name\" => \"Example Corp\",\n \"org_address_line_one\" => \"10 Example Street\",\n \"org_post_town\" => \"London\",\n \"org_postcode\" => \"SW1A 1AA\",\n \"org_country_code\" => \"GB\",\n ]),\n CURLOPT_RETURNTRANSFER => true,\n]);\n$result = json_decode(curl_exec($ch), true)[\"result\"];\n"
2930
+ },
2931
+ {
2932
+ "lang": "Go",
2933
+ "label": "Go",
2934
+ "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tbody, err := json.Marshal(map[string]string{\n\t\t\"email\": \"user@example.com\",\n\t\t\"name\": \"Jane Smith\",\n\t\t\"org_name\": \"Example Corp\",\n\t\t\"org_address_line_one\": \"10 Example Street\",\n\t\t\"org_post_town\": \"London\",\n\t\t\"org_postcode\": \"SW1A 1AA\",\n\t\t\"org_country_code\": \"GB\",\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tresp, err := http.Post(\"https://api.addresszen.com/v1/sign_up\", \"application/json\", bytes.NewReader(body))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer resp.Body.Close()\n\tvar data map[string]any\n\tif err := json.NewDecoder(resp.Body).Decode(&data); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", data[\"result\"])\n}\n"
2815
2935
  }
2816
2936
  ]
2817
2937
  }
@@ -2987,6 +3107,11 @@
2987
3107
  "lang": "PHP",
2988
3108
  "label": "PHP",
2989
3109
  "source": "<?php\n$response = file_get_contents(\"https://api.addresszen.com/v1/sign_up/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\");\n$result = json_decode($response, true)[\"result\"];\n"
3110
+ },
3111
+ {
3112
+ "lang": "Go",
3113
+ "label": "Go",
3114
+ "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tresp, err := http.Get(\"https://api.addresszen.com/v1/sign_up/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer resp.Body.Close()\n\tvar data map[string]any\n\tif err := json.NewDecoder(resp.Body).Decode(&data); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%+v\\n\", data[\"result\"])\n}\n"
2990
3115
  }
2991
3116
  ]
2992
3117
  }
@@ -3141,7 +3266,7 @@
3141
3266
  "format": "int32"
3142
3267
  },
3143
3268
  "example": 5,
3144
- "description": "**Limit**\n\nSpecifies the maximum number of records to retrieve.\n\nBy default the limit is 10. Requesting a larger result set adds latency.\n"
3269
+ "description": "**Limit**\n\nSpecifies the maximum number of records to retrieve.\n\nBy default the limit is 10. Requesting a larger result set adds latency. A value above 100 is reduced to 100 without an error.\n"
3145
3270
  },
3146
3271
  "BiasLonLatParam": {
3147
3272
  "name": "bias_lonlat",
@@ -3286,7 +3411,7 @@
3286
3411
  "schema": {
3287
3412
  "type": "string"
3288
3413
  },
3289
- "description": "**Bias by city**\n\nBoost addresses in the named city, town or locality. Case, spaces and accents are ignored. For UK addresses use `bias_posttown`.\n",
3414
+ "description": "**Bias by city**\n\nBoost addresses in the named city, town or locality. Case, spaces and accents are ignored.\n",
3290
3415
  "example": "San Francisco"
3291
3416
  },
3292
3417
  "BiasStateParam": {
@@ -4567,7 +4692,7 @@
4567
4692
  },
4568
4693
  "geo_coded": {
4569
4694
  "type": "boolean",
4570
- "description": "Indicates whether the address was geo-coded\n"
4695
+ "description": "Indicates whether the address was geocoded\n"
4571
4696
  },
4572
4697
  "lacs_indicator": {
4573
4698
  "type": "string",
@@ -14351,7 +14476,7 @@
14351
14476
  },
14352
14477
  "fit": {
14353
14478
  "type": "number",
14354
- "description": "A score represented as a number between 1 and 0. Fit compares the address elements present in your query against the matching address elements. It does not incorporate elements you have not presented in the score. A partial address (e.g. 123 Main St) will have a fit of 1 even though it is missing city and zip code. Its confidence score will be less than 1 however because it is missing some crucial elements.\n",
14479
+ "description": "A score represented as a number between 1 and 0. Fit compares the address elements present in your query against the matching address elements. It does not incorporate elements you have not presented in the score. A partial address (e.g. 123 Main St) will have a fit of 1 even though it is missing city and ZIP code. Its confidence score will be less than 1 however because it is missing some crucial elements.\n",
14355
14480
  "maximum": 1,
14356
14481
  "minimum": 0
14357
14482
  },
@@ -15113,16 +15238,16 @@
15113
15238
  },
15114
15239
  "name": {
15115
15240
  "type": "string",
15116
- "example": "Qwerty Widgets Limited",
15241
+ "example": "Acme Inc",
15117
15242
  "description": "Licensee individual or organisation name"
15118
15243
  },
15119
15244
  "address": {
15120
- "example": "12 High Street, Manchester",
15245
+ "example": "1010 Cauthen Ln, Alamogordo, NM",
15121
15246
  "type": "string",
15122
15247
  "description": "Licensee's first, second and third line address as well as post town concatenated by commas"
15123
15248
  },
15124
15249
  "postcode": {
15125
- "example": "BR8 7RE",
15250
+ "example": "88310",
15126
15251
  "type": "string",
15127
15252
  "description": "Licensee's postcode"
15128
15253
  },
@@ -15218,16 +15343,16 @@
15218
15343
  "properties": {
15219
15344
  "name": {
15220
15345
  "type": "string",
15221
- "example": "Qwerty Widgets Limited",
15346
+ "example": "Acme Inc",
15222
15347
  "description": "Licensee individual or organisation name"
15223
15348
  },
15224
15349
  "address": {
15225
- "example": "12 High Street, Manchester",
15350
+ "example": "1010 Cauthen Ln, Alamogordo, NM",
15226
15351
  "type": "string",
15227
15352
  "description": "Licensee's first, second and third line address as well as post town concatenated by commas"
15228
15353
  },
15229
15354
  "postcode": {
15230
- "example": "BR8 7RE",
15355
+ "example": "88310",
15231
15356
  "type": "string",
15232
15357
  "description": "Licensee's postcode"
15233
15358
  },