-
Notifications
You must be signed in to change notification settings - Fork 4
/
urlchannels.clj
33 lines (30 loc) · 1.09 KB
/
urlchannels.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.adsense.urlchannels
"AdSense Management API: urlchannels.
Accesses AdSense publishers' inventory and generates performance reports.
See: https://developers.google.com/adsense/management/api/reference/rest/v1.4/urlchannels"
(:require [cheshire.core :as json]
[clj-http.client :as http]
[happy.util :as util]))
(defn list$
"https://developers.google.com/adsense/management/api/reference/rest/v1.4/urlchannels/list
Required parameters: adClientId
Optional parameters: maxResults, pageToken
List all URL channels in the specified ad client for this AdSense account."
{:scopes ["https://www.googleapis.com/auth/adsense"
"https://www.googleapis.com/auth/adsense.readonly"]}
[auth args]
{:pre [(util/has-keys? args #{:adClientId})]}
(util/get-response
(http/get
(util/get-url
"https://www.googleapis.com/adsense/v1.4/"
"adclients/{adClientId}/urlchannels"
#{:adClientId}
args)
(merge-with
merge
{:throw-exceptions false,
:query-params args,
:accept :json,
:as :json}
auth))))