Error return from Google AdWords API - google-ads-api

I'm trying to upgrade my Google AdWords API process to the latest version (from v201506 to v201603), and I'm getting an error from Google:
Invalid ReportDefinition Xml: cvc-complex-type.2.4.d: Invalid content was found starting with element 'includeZeroImpressions'. No child element is expected at this point
My XML is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<reportDefinition>
<selector>
<fields>AccountDescriptiveName</fields>
<fields>Date</fields>
<fields>CampaignName</fields>
<fields>AdGroupName</fields>
<fields>Clicks</fields>
<fields>CampaignId</fields>
<fields>AdGroupId</fields>
</selector>
<reportName>AdWord-Performance-Report-#570e9612587f9</reportName>
<reportType>ADGROUP_PERFORMANCE_REPORT</reportType>
<dateRangeType>TODAY</dateRangeType>
<downloadFormat>TSV</downloadFormat>
<includeZeroImpressions>true</includeZeroImpressions>
</reportDefinition>
I couldn't find any references in the Google AdWords api blogs referring to changes in includeZeroImpressions... any ideas?

Damn.. nevermind. I see it in the Migration guide now:
The includeZeroImpressions field in ReportDefinition is removed. Use the HTTP header to include zero impressions in your report results instead.

Related

Bing Ads API Reporting Service returns error code 2015 "No Dimension Selected"

I'm trying to pull some data from the Bing Ads API but I keep getting error code 2015. I'm using Savon with Ruby on Rails. Here is the request:
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="https://bingads.microsoft.com/Reporting/v13" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns="https://bingads.microsoft.com/Reporting/v13">
<env:Header>
<AuthenticationToken>blahblahblah</AuthenticationToken>
<CustomerAccountId>blahblahblah</CustomerAccountId>
<CustomerId>blahblahblah</CustomerId>
<DeveloperToken>blahblahblah</DeveloperToken>
</env:Header>
<env:Body>
<tns:SubmitGenerateReportRequest>
<ReportRequest xsi:nil="false" xsi:type="AccountPerformanceReportRequest">
<ExcludeColumnHeaders>true</ExcludeColumnHeaders>
<ExcludeReportFooter>true</ExcludeReportFooter>
<ExcludeReportHeader>true</ExcludeReportHeader>
<Format>Csv</Format>
<Language>English</Language>
<ReportName>AccountPerformanceReportRequest</ReportName>
<ReturnOnlyCompleteData>false</ReturnOnlyCompleteData>
<Aggregation>Summary</Aggregation>
<Columns>
<AccountPerformanceReportColumn>Spend</AccountPerformanceReportColumn>
<AccountPerformanceReportColumn>Clicks</AccountPerformanceReportColumn>
<AccountPerformanceReportColumn>Conversions</AccountPerformanceReportColumn>
<AccountPerformanceReportColumn>Revenue</AccountPerformanceReportColumn>
</Columns>
<Filter xsi:nil="true"/>
<Scope>
<AccountIds xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<a1:long>blahblahblah</a1:long>
</AccountIds>
</Scope>
<Time>
<CustomDateRangeEnd>
<Day>02</Day>
<Month>04</Month>
<Year>2019</Year>
</CustomDateRangeEnd>
<CustomDateRangeStart>
<Day>01</Day>
<Month>04</Month>
<Year>2019</Year>
</CustomDateRangeStart>
<PredefinedTime xsi:nil="true"/>
<ReportTimeZone>EasternTimeUSCanada</ReportTimeZone>
</Time>
</ReportRequest>
</tns:SubmitGenerateReportRequest>
</env:Body>
</env:Envelope>
As you can see, I'm pulling the report with 'Summary' as the aggregation type. If I use 'Monthly' as the aggregation type and include a 'TimePeriod' column, it works perfectly, but if I do that then the data returned is for the whole month of April as opposed to the date range I've selected 04-01-2019..04-02-2019.
Here is the response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode>s:Server</faultcode>
<faultstring xml:lang="en-US">Invalid client data. Check the SOAP fault details for more information</faultstring> <detail>
<ApiFaultDetail xmlns="https://bingads.microsoft.com/Reporting/v13" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<TrackingId xmlns="https://adapi.microsoft.com">52665fe5-3eb8-42e0-ad8e-942e848297ce</TrackingId>
<BatchErrors/>
<OperationErrors>
<OperationError>
<Code>2015</Code>
<Details>No Dimension selected.</Details>
<ErrorCode>RequiredColumnsNotSelected</ErrorCode>
<Message>The specified report request does not specify all the required columns for this report type. Please submit a report request with the required columns for this report type, and optionally additional columns that are to be included in the report.</Message>
</OperationError>
</OperationErrors>
</ApiFaultDetail>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
The error code returned would lead me to believe that a TimePeriod column is required even for Summary, but that contradicts what is documented here.
All other aggregation types work with this setup. Any help would be greatly appreciated.
Good catch. We will update documentation to clarify that at least one attribute (non performance stat) e.g., AccountId must be included. Most of the other reports have specific attributes that must be included, whereas the account report does not. I hope this helps!

Mule HTTP Request Config with OAuth2

I am experimenting with OAuth2 on HTTP request connector. It is throwing the below exception always:
SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'oauth2:authorization-code-grant-type'. One of '{"http://www.mulesoft.org/schema/mule/core":annotations, "http://www.mulesoft.org/schema/mule/http":abstract-http-request-authentication-provider, "http://www.mulesoft.org/schema/mule/tcp":client-socket-properties, "http://www.mulesoft.org/schema/mule/tls":context, "http://www.mulesoft.org/schema/mule/http":raml-api-configuration, "http://www.mulesoft.org/schema/mule/http":proxy, "http://www.mulesoft.org/schema/mule/http":ntlm-proxy}' is expected
Here is my configuration:
<http:request-config name="SF_Authorize_Configuration" protocol="HTTPS" host="${login.host}" basePath="${oauth2.url}" port="80" doc:name="Authorize Configuration" >
<oauth2:authorization-code-grant-type clientId="my_client_id" clientSecret="my_client_secret" redirectionUrl="http://localhost:8081/oauth2callback">
<oauth2:authorization-request authorizationUrl="https://my.api.com/services/oauth2/authorize" localAuthorizationUrl="http://localhost:8082/authorization" scopes="access_user_details, read_user_files">
</oauth2:authorization-request>
<oauth2:token-request tokenUrl="https://my.api.com/services/oauth2/token"/>
</oauth2:authorization-code-grant-type>
</http:request-config>
This means that you have not provided the xml namespace for the xml tag.
If you have not used the UI to create this then please create using the design and then you can copy and paste your specific tag later by replacing it.
Edited answer,
It was similar for me for API kit. I re installed the Studio(Unzipped it again). This might work .
I have encountered the same issue. It was resolved by adding oauth2 namespace at the start mule tag, e.g.:
<mule xmlns:http="http://www.mulesoft.org/schema/mule/http"
...
xmlns:oauth2="http://www.mulesoft.org/schema/mule/oauth2"
http://www.mulesoft.org/schema/mule/oauth2
...
>

twilio Message tag not working

Why is this failing?
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Message>
<Body>Store Location: 123 Easy St.</Body>
<Media>https://demo.twilio.com/owl.png</Media>
</Message>
</Response>
I am receiving the following error:
Warning: 12200 - Schema validation warning
Parse error found on line 1 of the Raw Response
https://www.twilio.com/user/account/log/calls/CA7920533e98ffed29426d29e7e27746c8
I did a diff with the original example, and it's EXACTLY the same!
Original example is listed here:
https://www.twilio.com/docs/api/twiml/sms/message
I looks like you are building your application with Twilio as a Voice call application instead a SMS Message application.
The url https://www.twilio.com/user/account/log/calls/CA7920533e98ffed29426d29e7e27746c8 suggested that you are accesing your application as a voice call application, if not it would be https://www.twilio.com/user/account/log/messages/{some other id}.

Content is not allowed in prolog error on google contact api in ios

I want to add iPhone contact in Google contact. I was used Google contact API.but it give me error Content is not allowed in prolog.
i searched this error but not succeeded.
i can authenticate Google through web view and get access-token. After that call API
my request is http://www.google.com/m8/feeds/contacts/default/full?access_token=ya29.1.AADtN_V0YDqLjA7-GmIRZN6Z_yNdfe3z-AmZMx0-ZPPyAvJFsThMaT1E5aF1Qg
please help me regarding this issue.
method type = post
Content type = application/atom+xml;charset=utf-8
Thanks
if you are json
application/atom+json;charset=utf-8
if your xml means try this
$headers = array('Content-Type: application/atom+xml; charset=utf-8',
'Content-Length: '. strlen($xml),
'Authorization: GoogleLogin '. trim($authToken)),
'Connection: close');
For more information:
or
check your xml document tag
<!-- Correct -->
<?xml version="1.0" encoding="utf-8"?>

Fault calling SAP web service with generated SUDZC proxy: CX_ST_MATCH_ELEMENT

Trying to call a SAP SOAP Web Service from a generated sudzc app shows errors I don't know:
SudzCExamples[5192:f803] <?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:sap-
com:document:sap:soap:functions:mc-style"><soap:Body><ZComUrlGetrecords>
<IYear>2012</IYear></ZComUrlGetrecords></soap:Body></soap:Envelope>
SudzCExamples[5192:f803] <soap-env:Envelope xmlns:soap-
env="http://schemas.xmlsoap.org/soap/envelope/"><soap-env:Header></soap-env:Header><soap-
env:Body><soap-env:Fault><faultcode>soap-env:Server</faultcode><faultstring
xml:lang="en">CX_ST_MATCH_ELEMENT:XSLT exception.System expected element
'IYear'</faultstring><detail><ns:SystemFault
xmlns:ns="http://www.sap.com/webas/710/soap/runtime/abap/fault/system/">
<Host>undefined</Host><Component>APPL</Component><ChainedException>
<Exception_Name>CX_SOAP_CORE</Exception_Name><Exception_Text>CX_ST_MATCH_ELEMENT:XSLT
exception.System expected element 'IYear'</Exception_Text></ChainedException>
<ChainedException><Exception_Name>CX_SXMLP</Exception_Name><Exception_Text>XSLT
exception</Exception_Text></ChainedException><ChainedException>
<Exception_Name>CX_ST_MATCH_ELEMENT</Exception_Name><Exception_Text>System expected
element 'IYear': Main Program:/1BCDWB/WSS825E06E4DEC40F9171D|
Program:/1BCDWB/WSS825E06E4DEC40F9171D| Line: 18| Valid:X</Exception_Text>
</ChainedException></ns:SystemFault></detail></soap-env:Fault></soap-env:Body></soap-
env:Envelope>
2012-03-11 20:09:30.631 SudzCExamples[5192:f803] soap-env:Server CX_ST_MATCH_ELEMENT:XSLT
exception.System expected element 'IYear'
(null)
The strange thing is that it seems as if the request has the IYear element. Can someone tell me where to search the problem?
I ran into this same problem yesterday and discovered the solution after some experimentation. First thing I did was use my SoapUI client to make the request successfully. SoapUI comes with a free trial and even if you do not use the free trial you can still use it to make accesses to the web service without registering it. I used the xml from the successful request I made to compare against the request that SudzC was making. They differ in several ways, and the way that SudzC forms the request is not sufficient.
My suggestion to you is to compare the two requests and change SudzC's request to match the SoapUI request. You can do this by editing the Soap source code that SudzC gives to you, this source code is found particularly in the Soap.m file in the createEnvelope function.
Also, if your requests have an empty header SudzC does not include the header part of the request. Hard code in an empty header after the namespace portion of the envelope. Doing all this fixed this exact issue for me.

Resources