We have created test creds on Google ADs platform.Generated developer token, OAuth client ID and secret, and refresh token. We have created one campaign in the test account.
Now, we are trying to call Google ADs API's getCampaign() API with test creds (using clientID and client secret). In response we are getting status as OK, but no campaign related details are getting returned. Below is the request and response string:
Request
MethodName: google.ads.googleads.v7.services.GoogleAdsService/SearchStream
Endpoint: googleads.googleapis.com:443
Headers: {developer-token=REDACTED, x-goog-api-client=gl-java/15.0.2 gapic/ gax/1.63.0 grpc/1.36.0}
Body: customer_id: "6377058490"
query: "SELECT campaign.id, campaign.name FROM campaign ORDER BY campaign.id"
Response:
Headers: Metadata(content-type=application/grpc,request-id=sNH3h8fggnVsl1okVEEl-g,date=Tue, 15 Jun 2021 08:00:45 GMT,alt-svc=h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43")
Body: null
Failure message: null
Status: Status{code=OK, description=null, cause=null}.
It's because you're using REST. This will only return a single object per request, in your case, just the initial response (of the many you're expecting), which is just the authentication response.
https://developers.google.com/google-ads/api/rest/common/get
You should use one of the client libraries as there are custom methods used for getting all of the data (search, searchstream etc.)
In reality, the REST API is only useful for checking if you can authenticate, or query resource names. It's not practical for anything else.
You've made a great start and are ready to go. If you want to get the campaigns and IDs, I'd recommend using one of the libraries and if you're having issues, post the code here and we can help.