Developer Resources

API Documentation

Complete guide for integrating with YDengGrand Ads Platform and Google Ads API.

Authentication

Secure authentication using OAuth 2.0 for Google Ads API access.

OAuth 2.0 Flow

Our platform uses Google OAuth 2.0 for secure authentication. Users authorize access to their Google Ads accounts through the following flow:

1
Initiate OAuth Request

Redirect user to Google's consent screen

2
User Authorization

User grants permission to access Google Ads data

3
Receive Authorization Code

Google redirects back with authorization code

4
Exchange for Access Token

Server exchanges code for access and refresh tokens

Required OAuth Scopes

https://www.googleapis.com/auth/adwords Read and write access to Google Ads accounts

Token Management

  • Access tokens expire after 60 minutes
  • Refresh tokens are stored securely for long-term access
  • All tokens are encrypted at rest using AES-256
  • Tokens are transmitted over HTTPS only

Platform API Endpoints

RESTful API endpoints for the YDengGrand Ads Platform.

Authentication

POST
/api/auth/login
Email/password login
GET
/api/auth/google
Initiate Google OAuth flow
GET
/api/auth/callback
OAuth callback handler
POST
/api/auth/refresh
Refresh access token
POST
/api/auth/logout
Terminate user session

Campaigns

GET
/api/campaigns
List all campaigns
GET
/api/campaigns/:id
Get campaign details
POST
/api/campaigns/:id/optimize
Trigger campaign optimization

Reports

GET
/api/reports/performance
Performance metrics report
GET
/api/reports/keywords
Keyword performance report

Code Examples

Sample code for common API operations.

Authentication Example (Python)

# OAuth 2.0 Authentication Flow from google.ads.googleads.client import GoogleAdsClient from google.oauth2.credentials import Credentials # Load OAuth credentials credentials = Credentials( token="YOUR_ACCESS_TOKEN", refresh_token="YOUR_REFRESH_TOKEN", token_uri="https://oauth2.googleapis.com/token", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET" ) # Initialize Google Ads client client = GoogleAdsClient(credentials=credentials, developer_token="YOUR_DEV_TOKEN")

Query Campaigns (GAQL)

// Google Ads Query Language Example SELECT campaign.id, campaign.name, campaign.status, metrics.impressions, metrics.clicks, metrics.cost_micros FROM campaign WHERE campaign.status = 'ENABLED' ORDER BY metrics.cost_micros DESC LIMIT 100

API Request Example (cURL)

# Request campaign performance curl -X GET "https://api.ydenggrand.com/api/reports/performance" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"dateRange": "LAST_30_DAYS"}'

Need Help?

Our API support team is here to assist with integration questions.