Thank you for the reply, as mentioned if sucessfull, response body is containing the above said json, but we are not seeing json response while streaming that is if we request 100,000 records then an array of results object containing each 10,000 records are being sent, which are not at all formatted correctly, we are trying to get the json records processing using streams, as these are in the format of string until we recieve the entire json it is becoming useless, we want to process the records as soon as the streaming had started, for this purpose the chunks that are being sent as part of stream should be in json format, please let us know if json for stream chunks are possible from your side or we need to wait for the entire stream to be completed and then process the json
Regards On Tuesday, September 27, 2022 at 7:03:15 PM UTC+5:30 adsapi wrote: > Hi, > > Thanks for getting back to us. > > For REST API search stream format, you may refer below cURL sample: > > > curl -f --request POST > "https://googleads.googleapis.com/v${API_VERSION}/customers/${CUSTOMER_ID}/googleAds:searchStream" > \ > > --header "Content-Type: application/json" \ > > --header "developer-token: ${DEVELOPER_TOKEN}" \ > > --header "login-customer-id: ${MANAGER_CUSTOMER_ID}" \ > > --header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \ > > --data '{ > > "query": " > > SELECT campaign.name, > > campaign_budget.amount_micros, > > campaign.status, > > campaign.optimization_score, > > campaign.advertising_channel_type, > > metrics.clicks, > > metrics.impressions, > > metrics.ctr, > > metrics.average_cpc, > > metrics.cost_micros, > > campaign.bidding_strategy_type > > FROM campaign > > WHERE segments.date DURING LAST_7_DAYS > > AND campaign.status != 'REMOVED' > > " > > }' > > *Response body:* > > If successful, the response body contains data with the following > structure: > > Response message for GoogleAdsService.SearchStream. > <https://developers.google.com/google-ads/api/rest/reference/rest/v11/customers.googleAds/searchStream#google.ads.googleads.v11.services.GoogleAdsService.SearchStream> > > JSON representation > > > > [ > { > "results": [ > { > object (GoogleAdsRow) > } > ], > "fieldMask": string, > "summaryRow": { > object (GoogleAdsRow) > }, > "requestId": string > } > ] > > For more information, you may refer to this *guide* > <https://developers.google.com/google-ads/api/rest/reference/rest/v11/customers.googleAds/searchStream> > . > > Regards, > [image: Google Logo] > Yasar > Google Ads API Team > > > ref:_00D1U1174p._5004Q2ePgPj:ref > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog: https://googleadsdeveloper.blogspot.com/ =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en --- You received this message because you are subscribed to the Google Groups "Google Ads API and AdWords API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/e1274bcc-c423-4449-bd5b-760fb017b5ccn%40googlegroups.com.
