README
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
aclendpoint in SearchAds API.- AdGroupQuery ⇐
Request Make request on
adgroups/${id}endpoint.- AdGroupsQuery ⇐
Request Make request on
adgroupsendpoint.- Api
- CampaignQuery ⇐
Request Make request on
campaigns/${id}endpoint.- CampaignsQuery ⇐
Request Make request on
campaignsendpoint.- FindQuery ⇐
Request Make request on
findendpoint.- 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))
AclQuery ⇐ Request
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() ⇒
aclQuery.delete() ⇒ Promise
Delete on endpoint.
Kind: instance method of AclQuery
aclQuery.get() ⇒ Promise
Get on endpoint.
Kind: instance method of AclQuery
aclQuery.post(data) ⇒ Promise
Post on endpoint.
Kind: instance method of AclQuery
| Param | Type | Description |
|---|---|---|
| data | any |
post payload |
aclQuery.put(data) ⇒ Promise
Put on endpoint.
Kind: instance method of AclQuery
| Param | Type | Description |
|---|---|---|
| data | any |
put payload |
aclQuery.url() ⇒ String
Get endpoint url
Kind: instance method of AclQuery
AdGroupQuery ⇐ Request
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() ⇒
adGroupQuery.delete() ⇒ Promise
Delete on endpoint.
Kind: instance method of AdGroupQuery
adGroupQuery.get() ⇒ Promise
Get on endpoint.
Kind: instance method of AdGroupQuery
adGroupQuery.post(data) ⇒ Promise
Post on endpoint.
Kind: instance method of AdGroupQuery
| Param | Type | Description |
|---|---|---|
| data | any |
post payload |
adGroupQuery.put(data) ⇒ Promise
Put on endpoint.
Kind: instance method of AdGroupQuery
| Param | Type | Description |
|---|---|---|
| data | any |
put payload |
adGroupQuery.url() ⇒ String
Get endpoint url
Kind: instance method of AdGroupQuery
AdGroupsQuery ⇐ Request
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() ⇒
adGroupsQuery.delete() ⇒ Promise
Delete on endpoint.
Kind: instance method of AdGroupsQuery
adGroupsQuery.get() ⇒ Promise
Get on endpoint.
Kind: instance method of AdGroupsQuery
adGroupsQuery.post(data) ⇒ Promise
Post on endpoint.
Kind: instance method of AdGroupsQuery
| Param | Type | Description |
|---|---|---|
| data | any |
post payload |
adGroupsQuery.put(data) ⇒ Promise
Put on endpoint.
Kind: instance method of AdGroupsQuery
| Param | Type | Description |
|---|---|---|
| data | any |
put payload |
adGroupsQuery.url() ⇒ String
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. |
CampaignQuery ⇐ Request
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() ⇒
campaignQuery.delete() ⇒ Promise
Delete on endpoint.
Kind: instance method of CampaignQuery
campaignQuery.get() ⇒ Promise
Get on endpoint.
Kind: instance method of CampaignQuery
campaignQuery.post(data) ⇒ Promise
Post on endpoint.
Kind: instance method of CampaignQuery
| Param | Type | Description |
|---|---|---|
| data | any |
post payload |
campaignQuery.put(data) ⇒ Promise
Put on endpoint.
Kind: instance method of CampaignQuery
| Param | Type | Description |
|---|---|---|
| data | any |
put payload |
campaignQuery.url() ⇒ String
Get endpoint url
Kind: instance method of CampaignQuery
CampaignsQuery ⇐ Request
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() ⇒
campaignsQuery.delete() ⇒ Promise
Delete on endpoint.
Kind: instance method of CampaignsQuery
campaignsQuery.get() ⇒ Promise
Get on endpoint.
Kind: instance method of CampaignsQuery
campaignsQuery.post(data) ⇒ Promise
Post on endpoint.
Kind: instance method of CampaignsQuery
| Param | Type | Description |
|---|---|---|
| data | any |
post payload |
campaignsQuery.put(data) ⇒ Promise
Put on endpoint.
Kind: instance method of CampaignsQuery
| Param | Type | Description |
|---|---|---|
| data | any |
put payload |
campaignsQuery.url() ⇒ String
Get endpoint url
Kind: instance method of CampaignsQuery
FindQuery ⇐ Request
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() ⇒
findQuery.delete() ⇒ Promise
Delete on endpoint.
Kind: instance method of FindQuery
findQuery.get() ⇒ Promise
Get on endpoint.
Kind: instance method of FindQuery
findQuery.post(data) ⇒ Promise
Post on endpoint.
Kind: instance method of FindQuery
| Param | Type | Description |
|---|---|---|
| data | any |
post payload |
findQuery.put(data) ⇒ Promise
Put on endpoint.
Kind: instance method of FindQuery
| Param | Type | Description |
|---|---|---|
| data | any |
put payload |
findQuery.url() ⇒ String
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() ⇒
request.delete() ⇒ Promise
Delete on endpoint.
Kind: instance method of Request
request.get() ⇒ Promise
Get on endpoint.
Kind: instance method of Request
request.post(data) ⇒ Promise
Post on endpoint.
Kind: instance method of Request
| Param | Type | Description |
|---|---|---|
| data | any |
post payload |
request.put(data) ⇒ Promise
Put on endpoint.
Kind: instance method of Request
| Param | Type | Description |
|---|---|---|
| data | any |
put payload |
request.url() ⇒ String
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. |