Hi
I'm researching google ads API and started to work out the whole ad create process via API (only using CURL not using client library).
As per documentation, we should use mutate for CREATE/UPDATE/REMOVE operations for an endpoint. In the way, I've created campaign budget, campaign, adgroups successfully via API mutate operation. However, I'm trying to create an ad. But I'm facing some issues while creating that.
Here I'll explain two cases which I've tried.
1. First I've used mutate create operation for google ads endpoint.
With the corresponding request body.
But I got the following error.
Invalid JSON payload received. Unknown name \"create\" at 'operations[0]': Cannot find field.
As per this error, I thought, we don't have create mutate for ads API. So I've tried adGroupAds endpoint.
Request Body
{
"operations": [
{
"create": {
"status": "PAUSED",
"ad": {
"name": "My Test ad"
},
"ad_group": "customers/{customer_id}/adGroups/{adGroupId}"
}
}
]
}
But I got resource not found error. I've also passed the resource_name param in the request body in the following ways
1. "resource_name": "customers/{customer_id}/adGroupAds/{adGroupId}/-1",
2. "resource_name": "customers/{customer_id}/adGroupAds/{adGroupId}~-1"
I'm not what I'm missing and how to create an ad using CURL. Please help me to overcome this. I'm not having a proper example for this endpoint in the API documentation using CURL. It will be more helpful if you help me with the sample request body, endpoint CURL, and what are the necessary params should be passed for the endpoint.
Thanks in advance.