AI Newsletter Digest improvements: fixed QP soft line break decoding, URL extraction, and content cleaning

This commit is contained in:
Krilly
2026-03-04 13:29:22 +00:00
parent 29a98137a7
commit 57dd294675
13706 changed files with 2114953 additions and 237629 deletions

View File

@@ -9,10 +9,80 @@
/google-merchant/{sub-api}/{version}/accounts/{accountId}/{resource}
```
The Merchant API uses sub-APIs: `products`, `accounts`, `datasources`, `reports`, `promotions`, `inventories`, `notifications`, `conversions`, `lfp`
The Merchant API uses sub-APIs: `products`, `accounts`, `datasources`, `reports`, `promotions`, `inventories`, `notifications`, `conversions`
**Important:** The v1 API requires one-time developer registration per Merchant Center account. Complete the registration steps below before using any endpoints.
## Developer Registration
Before using v1 endpoints, you must complete a one-time registration:
### Step 1: Get Your Account ID
**Option A: Try fetching via API first**
Try listing accounts using the v1beta endpoint. If this works, you can get your account ID automatically:
```bash
GET /google-merchant/accounts/v1beta/accounts
```
Response (if successful):
```json
{
"accounts": [
{"accountId": "123456789", "accountName": "My Store"}
]
}
```
**Option B: From Merchant Center UI (if Option A fails)**
If the v1beta endpoint is unavailable or returns an error:
1. Log in to [Google Merchant Center](https://merchants.google.com/)
2. Your account ID is in the URL: `https://merchants.google.com/mc/overview?a=YOUR_ACCOUNT_ID`
For example, if your URL is `https://merchants.google.com/mc/overview?a=123456789`, your account ID is `123456789`.
### Step 2: Register for API Access
```bash
POST /google-merchant/accounts/v1/accounts/{accountId}/developerRegistration:registerGcp
Content-Type: application/json
{
"developerEmail": "your-email@example.com"
}
```
Replace `{accountId}` with your account ID from Step 1, and use the email associated with your Google account.
**Response:**
```json
{
"name": "accounts/123456789/developerRegistration",
"gcpIds": ["..."]
}
```
### Step 3: Verify Registration
After registration, test that v1 endpoints work:
```bash
GET /google-merchant/accounts/v1/accounts/{accountId}
```
**Note:** Registration only needs to be done once per Merchant Center account. After successful registration, all v1 endpoints will work for that account.
## Common Endpoints
### List Accounts
```bash
GET /google-merchant/accounts/v1/accounts
```
### List Products
```bash
GET /google-merchant/products/v1/accounts/{accountId}/products
@@ -34,7 +104,7 @@ Content-Type: application/json
"offerId": "sku123",
"contentLanguage": "en",
"feedLabel": "US",
"attributes": {
"productAttributes": {
"title": "Product Title",
"link": "https://example.com/product",
"imageLink": "https://example.com/image.jpg",
@@ -60,33 +130,47 @@ POST /google-merchant/reports/v1/accounts/{accountId}/reports:search
Content-Type: application/json
{
"query": "SELECT offer_id, title, clicks FROM product_performance_view WHERE date BETWEEN '2026-01-01' AND '2026-01-31'"
"query": "SELECT id, offer_id, title FROM product_view LIMIT 10"
}
```
Note: The `product_view` table requires the `id` field in SELECT clause.
### List Promotions
```bash
GET /google-merchant/promotions/v1/accounts/{accountId}/promotions
```
Note: Requires Promotions program enrollment.
### Get Account
```bash
GET /google-merchant/accounts/v1/accounts/{accountId}
```
### List Regional Inventories
```bash
GET /google-merchant/inventories/v1/accounts/{accountId}/products/{productId}/regionalInventories
```
### List Local Inventories
```bash
GET /google-merchant/inventories/v1/accounts/{accountId}/products/{productId}/localInventories
```
Note: Local inventories only work for products with LOCAL channel.
## Notes
- **Developer registration required** - Complete registration before using v1 endpoints
- Authentication is automatic - the router injects the OAuth token
- Account ID is your Merchant Center numeric ID (visible in MC URL)
- Product IDs use format `contentLanguage~feedLabel~offerId`
- Monetary values use micros (divide by 1,000,000)
- Products can only be inserted in data sources of type `API`
- Products can only be inserted in data sources with `input: "API"` type
- Uses token-based pagination with `pageSize` and `pageToken`
- Promotions require account enrollment in Promotions program
- Local inventories only work for LOCAL channel products
## Resources