-
Notifications
You must be signed in to change notification settings - Fork 4
/
cities.clj
33 lines (29 loc) · 1.12 KB
/
cities.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
(ns happygapi.dfareporting.cities
"Campaign Manager 360 API: cities.
Build applications to efficiently manage large or complex trafficking, reporting, and attribution workflows for Campaign Manager 360.
See: https://developers.google.com/doubleclick-advertisers/api/reference/rest/v4/cities"
(:require [cheshire.core :as json]
[clj-http.client :as http]
[happy.util :as util]))
(defn list$
"https://developers.google.com/doubleclick-advertisers/api/reference/rest/v4/cities/list
Required parameters: profileId
Optional parameters: namePrefix, countryDartIds, dartIds, regionDartIds
Retrieves a list of cities, possibly filtered."
{:scopes ["https://www.googleapis.com/auth/dfatrafficking"]}
[auth parameters]
{:pre [(util/has-keys? parameters #{:profileId})]}
(util/get-response
(http/get
(util/get-url
"https://dfareporting.googleapis.com/dfareporting/v4/"
"userprofiles/{+profileId}/cities"
#{:profileId}
parameters)
(merge-with
merge
{:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))