/
beaconinfo.clj
46 lines (40 loc) · 1.4 KB
/
beaconinfo.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
(ns happygapi.proximitybeacon.beaconinfo
"Proximity Beacon API: beaconinfo.
Registers, manages, indexes, and searches beacons.
See: https://developers.google.com/beacons/proximity/api/reference/rest/v1beta1/beaconinfo"
(:require [cheshire.core :as json]
[clj-http.client :as http]
[happy.util :as util]))
(defn getforobserved$
"https://developers.google.com/beacons/proximity/api/reference/rest/v1beta1/beaconinfo/getforobserved
Required parameters: none
Optional parameters: none
Body:
{:observations [{:advertisedId AdvertisedId,
:telemetry string,
:timestampMs string}],
:namespacedTypes [string]}
Given one or more beacon observations, returns any beacon information
and attachments accessible to your application. Authorize by using the
[API
key](https://developers.google.com/beacons/proximity/get-started#request_a_browser_api_key)
for the application."
{:scopes nil}
[auth parameters body]
{:pre [(util/has-keys? parameters #{})]}
(util/get-response
(http/post
(util/get-url
"https://proximitybeacon.googleapis.com/"
"v1beta1/beaconinfo:getforobserved"
#{}
parameters)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))