The error message "The request message is null" with ErrorCode: NullRequest
indicates that the request body may be incomplete or improperly formatted when sent to the Microsoft Advertising Campaign Management API. This typically happens when the API expects certain data to be passed but it’s missing or malformed. Here are a few things you can check to resolve this:
Check the structure of the request body: The reportRequest
field should be fully populated with valid values. Ensure that all required fields (such as accountIds
, campaignId
, and time
) are correctly set and not null
unless optional.
Ensure accountIds
is properly set: Your request has "accountIds": null
in the scope
field, which might be causing the issue. If you're targeting specific accounts, you need to pass an array with valid account IDs or omit it entirely if not needed.
Verify Campaign IDs: Check the validity of the campaignId
and accountId
in the campaignReportScopes
array. Ensure that these values exist in the account you're querying against.
Check the time
fields: You are using both a custom date range and a predefined time ("predefinedTime": "ChennaiKolkataMumbaiNewDelhi"
). Make sure that the time zone and date range are correctly specified and compatible.
Validate the request format: Ensure that the API expects the fields as you've structured them (e.g., columns
, aggregation
, etc.) and that no required fields are missing.
If everything looks good but the error persists, you may want to review API documentation for any required changes or updates regarding data formats or parameters. You can also check Microsoft’s API forums or contact their support for more detailed guidance.