regarding making asset group using rest interface

44 views
Skip to first unread message

Dushyant

unread,
Aug 21, 2024, 4:36:15 AM8/21/24
to Google Ads API and AdWords API Forum
Screenshot from 2024-08-21 12-18-09.png
after reffering to your documnetation for making an asset group in php, i tried the same and made a curl for making an asset group . as shown in your documentation, that we passed performance_max_temporary_id in the campaign field , it throws an error as shown below in the curl : 
curl --location 'https://googleads.googleapis.com/v17/customers/8702376846/assetGroups:mutate' \
--header 'Content-Type: application/json' \
--header 'developer-token: 0-4PjaUzBnyeiqsEkhbpgg' \
--header 'login-customer-id: 8663393180' \
--header 'Authorization: Bearer ya29.a0AcM612xfUrX7gKzHcjmFBLFoW38ybbPs6bbOiLt7Dq5QRatNp3vdUZmhAhIa0D-pYsgseL5VFoA-xWL4IfEctpFkE5RWJKZyvKXe1LztcwqVGGVokA4VTv_HKGl5IlkEq1S_oFvoxs_V2f1HbTZta7FvWVFc6wKFvvvATDLWDgaCgYKAa4SARMSFQHGX2MibNVpgzEfCzZ2cdIxHDkwJA0177' \
--data '{
    "operations": [
        {
            "create": {
                "resourceName": "customers/8702376846/assetGroups/-1",
               
                "campaign": "customers/8702376846/campaigns/-2",
                "name": "latest-pm-asset-group",
                "finalUrls": [
                    "https://google.com"
                ],
                "finalMobileUrls": [
                    "https://your-mobile-landing-page.com"
                ],
                "status": "PAUSED"
            }
        }
    ]
}'

the error i get is shown below : 
{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT",
"details": [
{
"errors": [
{
"errorCode": {
"mutateError": "RESOURCE_NOT_FOUND"
},
"message": "Resource was not found.",
"trigger": {
"int64Value": "-2"
},
"location": {
"fieldPathElements": [
{
"fieldName": "operations",
"index": 0
},
{
"fieldName": "create"
},
{
"fieldName": "campaign"
}
]
}
}
],
"requestId": "GAjzrcpRo44Zm56AtcAzJg"
}
]
}
} please guide me where am i making a mistake

Google Ads API Forum Advisor

unread,
Aug 21, 2024, 8:36:16 AM8/21/24
to dkno...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

I understand that you are encountering the 'RESOURCE_NOT_FOUND' error. This occurs when the request referred to a resource that could not be found. The common cause for this error is that the request attempted to mutate or otherwise reference a resource that does not exist or has been removed. Or, the given resource name for the resource is malformed.

From the API logs, I feel that the error is due to the wrong usage of temporary IDs. Since you are just performing one operation and not working with BatchJobService, you can avoid using temporary IDs. Firstly, you need to pass the campaign ID instead of using the temporary ID '-2'. Also, no resource name is expected while creating a new asset group. Try these suggestions and let us know how it goes. I would recommend you refer to this guide on 'AssetGroupOperation' for more information.

Note that the temporary IDs are beneficial while working with BatchJobService. I would recommend you refer to this guide on 'Using temporary IDs' for more information on using temporary resource names. 

 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vFC7n:ref" (ADR-00264152)

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages