-
Notifications
You must be signed in to change notification settings - Fork 4
/
creativeAssets.clj
52 lines (46 loc) · 1.67 KB
/
creativeAssets.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
47
48
49
50
51
52
(ns happygapi.dfareporting.creativeAssets
"DCM/DFA Reporting And Trafficking API: creativeAssets.
Manages your DoubleClick Campaign Manager ad campaigns and reports.
See: https://developers.google.com/doubleclick-advertisers/api/reference/rest/v3.4/creativeAssets"
(:require [cheshire.core :as json]
[clj-http.client :as http]
[happy.util :as util]))
(defn insert$
"https://developers.google.com/doubleclick-advertisers/api/reference/rest/v3.4/creativeAssets/insert
Required parameters: advertiserId, profileId
Optional parameters: none
Body:
{:assetIdentifier {:name string, :type string},
:clickTags [{:clickThroughUrl CreativeClickThroughUrl,
:eventName string,
:name string}],
:detectedFeatures [string],
:id string,
:idDimensionValue {:dimensionName string,
:etag string,
:id string,
:kind string,
:matchType string,
:value string},
:kind string,
:warnedValidationRules [string]}
Inserts a new creative asset."
{:scopes ["https://www.googleapis.com/auth/dfatrafficking"]}
[auth args body]
{:pre [(util/has-keys? args #{:advertiserId :profileId})]}
(util/get-response
(http/post
(util/get-url
"https://www.googleapis.com/dfareporting/v3.4/"
"userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets"
#{:advertiserId :profileId}
args)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params args,
:accept :json,
:as :json}
auth))))