Apple SearchAds api wrapper
About
TODO
Installation
npm install @aexol/searchads-js
Usage
API Reference
Modules
- @aexol/searchads-js
-
SearchAds API
Classes
-
AclQuery ⇐
Request
-
Queries on
acl
endpoint in SearchAds API. -
AdGroupQuery ⇐
Request
-
Make request on
adgroups/${id}
endpoint. -
AdGroupsQuery ⇐
Request
-
Make request on
adgroups
endpoint. - Api
-
CampaignQuery ⇐
Request
-
Make request on
campaigns/${id}
endpoint. -
CampaignsQuery ⇐
Request
-
Make request on
campaigns
endpoint. -
FindQuery ⇐
Request
-
Make request on
find
endpoint. - Request
-
Request to SearchAds API.
- QueryBase
-
Base query with request.
@aexol/searchads-js
SearchAds API
Example
import Api from '@aexol/searchads-js'
import fs from 'fs'
const auth = {
pem: fs.readFileSync('cert.pem'),
key: fs.readFileSync('cert.key'),
orgId: 1
}
const api = new Api(auth)
api.campaigns.get().then(console.log).catch(e => console.log(e.message))
Request
AclQuery ⇐ Queries on acl
endpoint in SearchAds API.
Kind: global class
Extends: Request
-
AclQuery ⇐
Request
-
.delete() ⇒
Promise
-
.get() ⇒
Promise
-
.post(data) ⇒
Promise
-
.put(data) ⇒
Promise
-
.url() ⇒
String
-
.delete() ⇒
Promise
aclQuery.delete() ⇒ Delete on endpoint.
Kind: instance method of AclQuery
Promise
aclQuery.get() ⇒ Get on endpoint.
Kind: instance method of AclQuery
Promise
aclQuery.post(data) ⇒ Post on endpoint.
Kind: instance method of AclQuery
Param | Type | Description |
---|---|---|
data | any |
post payload |
Promise
aclQuery.put(data) ⇒ Put on endpoint.
Kind: instance method of AclQuery
Param | Type | Description |
---|---|---|
data | any |
put payload |
String
aclQuery.url() ⇒ Get endpoint url
Kind: instance method of AclQuery
Request
AdGroupQuery ⇐ Make request on adgroups/${id}
endpoint.
Kind: global class
Extends: Request
-
AdGroupQuery ⇐
Request
-
.delete() ⇒
Promise
-
.get() ⇒
Promise
-
.post(data) ⇒
Promise
-
.put(data) ⇒
Promise
-
.url() ⇒
String
-
.delete() ⇒
Promise
adGroupQuery.delete() ⇒ Delete on endpoint.
Kind: instance method of AdGroupQuery
Promise
adGroupQuery.get() ⇒ Get on endpoint.
Kind: instance method of AdGroupQuery
Promise
adGroupQuery.post(data) ⇒ Post on endpoint.
Kind: instance method of AdGroupQuery
Param | Type | Description |
---|---|---|
data | any |
post payload |
Promise
adGroupQuery.put(data) ⇒ Put on endpoint.
Kind: instance method of AdGroupQuery
Param | Type | Description |
---|---|---|
data | any |
put payload |
String
adGroupQuery.url() ⇒ Get endpoint url
Kind: instance method of AdGroupQuery
Request
AdGroupsQuery ⇐ Make request on adgroups
endpoint.
Kind: global class
Extends: Request
Properties
Name | Type | Description |
---|---|---|
find | FindQuery |
Get find for adgroups. |
[id] | AdGroup |
Get adgroup by id. |
-
AdGroupsQuery ⇐
Request
-
.delete() ⇒
Promise
-
.get() ⇒
Promise
-
.post(data) ⇒
Promise
-
.put(data) ⇒
Promise
-
.url() ⇒
String
-
.delete() ⇒
Promise
adGroupsQuery.delete() ⇒ Delete on endpoint.
Kind: instance method of AdGroupsQuery
Promise
adGroupsQuery.get() ⇒ Get on endpoint.
Kind: instance method of AdGroupsQuery
Promise
adGroupsQuery.post(data) ⇒ Post on endpoint.
Kind: instance method of AdGroupsQuery
Param | Type | Description |
---|---|---|
data | any |
post payload |
Promise
adGroupsQuery.put(data) ⇒ Put on endpoint.
Kind: instance method of AdGroupsQuery
Param | Type | Description |
---|---|---|
data | any |
put payload |
String
adGroupsQuery.url() ⇒ Get endpoint url
Kind: instance method of AdGroupsQuery
Api
Kind: global class
Properties
Name | Type | Description |
---|---|---|
campaigns | CampaignsQuery |
Instance of {CampaignsQuery} for this api obejct. |
acl | AclQuery |
Instance of {AclQuery} for this api object. |
new Api(auth)
SearchAds API.
Param | Description |
---|---|
auth | SearchAds API auth certificates. |
Request
CampaignQuery ⇐ Make request on campaigns/${id}
endpoint.
Kind: global class
Extends: Request
Properties
Name | Type | Description |
---|---|---|
adgroups | AdGroups |
Get adgroups for campaign |
-
CampaignQuery ⇐
Request
-
.delete() ⇒
Promise
-
.get() ⇒
Promise
-
.post(data) ⇒
Promise
-
.put(data) ⇒
Promise
-
.url() ⇒
String
-
.delete() ⇒
Promise
campaignQuery.delete() ⇒ Delete on endpoint.
Kind: instance method of CampaignQuery
Promise
campaignQuery.get() ⇒ Get on endpoint.
Kind: instance method of CampaignQuery
Promise
campaignQuery.post(data) ⇒ Post on endpoint.
Kind: instance method of CampaignQuery
Param | Type | Description |
---|---|---|
data | any |
post payload |
Promise
campaignQuery.put(data) ⇒ Put on endpoint.
Kind: instance method of CampaignQuery
Param | Type | Description |
---|---|---|
data | any |
put payload |
String
campaignQuery.url() ⇒ Get endpoint url
Kind: instance method of CampaignQuery
Request
CampaignsQuery ⇐ Make request on campaigns
endpoint.
Kind: global class
Extends: Request
Properties
Name | Type | Description |
---|---|---|
find | FindQuery |
Get find for campaigns |
[id] | Campaign |
Get campaign by id. |
-
CampaignsQuery ⇐
Request
-
.delete() ⇒
Promise
-
.get() ⇒
Promise
-
.post(data) ⇒
Promise
-
.put(data) ⇒
Promise
-
.url() ⇒
String
-
.delete() ⇒
Promise
campaignsQuery.delete() ⇒ Delete on endpoint.
Kind: instance method of CampaignsQuery
Promise
campaignsQuery.get() ⇒ Get on endpoint.
Kind: instance method of CampaignsQuery
Promise
campaignsQuery.post(data) ⇒ Post on endpoint.
Kind: instance method of CampaignsQuery
Param | Type | Description |
---|---|---|
data | any |
post payload |
Promise
campaignsQuery.put(data) ⇒ Put on endpoint.
Kind: instance method of CampaignsQuery
Param | Type | Description |
---|---|---|
data | any |
put payload |
String
campaignsQuery.url() ⇒ Get endpoint url
Kind: instance method of CampaignsQuery
Request
FindQuery ⇐ Make request on find
endpoint.
Kind: global class
Extends: Request
-
FindQuery ⇐
Request
-
.delete() ⇒
Promise
-
.get() ⇒
Promise
-
.post(data) ⇒
Promise
-
.put(data) ⇒
Promise
-
.url() ⇒
String
-
.delete() ⇒
Promise
findQuery.delete() ⇒ Delete on endpoint.
Kind: instance method of FindQuery
Promise
findQuery.get() ⇒ Get on endpoint.
Kind: instance method of FindQuery
Promise
findQuery.post(data) ⇒ Post on endpoint.
Kind: instance method of FindQuery
Param | Type | Description |
---|---|---|
data | any |
post payload |
Promise
findQuery.put(data) ⇒ Put on endpoint.
Kind: instance method of FindQuery
Param | Type | Description |
---|---|---|
data | any |
put payload |
String
findQuery.url() ⇒ Get endpoint url
Kind: instance method of FindQuery
Request
Request to SearchAds API.
Kind: global class
Properties
Name | Type | Description |
---|---|---|
endpoint | String |
Search ads api endpoint. |
auth | ICertAuth |
Search ads api auth. |
headers | Headers |
Search ads api request headers. |
-
Request
-
.delete() ⇒
Promise
-
.get() ⇒
Promise
-
.post(data) ⇒
Promise
-
.put(data) ⇒
Promise
-
.url() ⇒
String
-
.delete() ⇒
Promise
request.delete() ⇒ Delete on endpoint.
Kind: instance method of Request
Promise
request.get() ⇒ Get on endpoint.
Kind: instance method of Request
Promise
request.post(data) ⇒ Post on endpoint.
Kind: instance method of Request
Param | Type | Description |
---|---|---|
data | any |
post payload |
Promise
request.put(data) ⇒ Put on endpoint.
Kind: instance method of Request
Param | Type | Description |
---|---|---|
data | any |
put payload |
String
request.url() ⇒ Get endpoint url
Kind: instance method of Request
QueryBase
Base query with request.
queryBase.request
Kind: instance property of QueryBase
Properties
Name | Type | Description |
---|---|---|
request | Request |
returns object for this endpoint. |