Adsense API integration

17 views
Skip to first unread message

Deepthi Pothu

unread,
Oct 6, 2009, 6:24:26 AM10/6/09
to adsen...@googlegroups.com
Hi,

I am trying to integrate api, i am getting few problems in sandox environment

1. Unable to assosiate with existing account. Always getting the error as The account corresponding to the specified client email address does not match with the provided zipcode or telephone number. Even though i have given correct data.

2. While generating ad code , most of the times i am getting the error as  An internal error has occurred. Please retry your request.
    
I tried with the fowlloing publisher ids  ca-pub-8141224238003433, ca-pub-4409870126565664,ca-pub-9666233375004361,ca-pub-0689532190716586,ca-pub-0325501181921051,ca-pub-2478016316309034,ca-pub-5755083324126765,ca-pub-6894198497632435

3. When can i verify the account status. I am trying to verify after creation, in this case i am getting the error as An internal error has occurred. Please retry your request.

Could you please verify the publisher ids once.

Thanks,
Talluri

Google AdSense API Support Team

unread,
Oct 6, 2009, 5:11:01 PM10/6/09
to AdSense API Forum
Talluri,

1. What account are you trying to associate with? Are you sure it
exists in the sandbox, and are you sure you haven't swapped postal
code and phone number in your request (their position matters).

2. The publisher IDs are fine for the sandbox, though there's an
errant space in a few of them. It would be helpful if you could get a
trace of the XML you're sending across the wire. Internal errors
almost always represent some validation problem with the data you're
sending.

3. You should be able to call getAssociationStatus at any time. I
believe getApprovalStatus requires an active association between your
developer account and the publisher, though.

Cheers,
Wes
AdSense API

On Oct 6, 3:24 am, Deepthi Pothu <talluri.ju...@gmail.com> wrote:
> Hi,
>
> I am trying to integrate api, i am getting few problems in sandox
> environment
>
> 1. Unable to assosiate with existing account. Always getting the error as *The
> account corresponding to the specified client email address does not match
> with the provided zipcode or telephone number.* Even though i have given
> correct data.
>
> 2. While generating ad code , most of the times i am getting the error as  *An
> internal error has occurred. Please retry your request.
>     * I tried with the fowlloing publisher ids  *ca-pub-8141224238003433,
> ca-pub-4409870126565664,ca-pub-9666233375004361,ca-pub-0689532190716586,ca- pub-0325501181921051,ca-pub-2478016316309034,ca-pub-5755083324126765,ca-pub -6894198497632435
>
> *3.* *When can i verify the account status. I am trying to verify after
> creation, in this case i am getting the error as* An internal error has
> occurred. Please retry your request.
> **
> *Could you please verify the publisher ids once.*
>
> Thanks,
> Talluri
> *

Deepthi Pothu

unread,
Oct 7, 2009, 1:41:39 AM10/7/09
to adsen...@googlegroups.com

Hello Team,

These are the steps i am  following

1. I have created one account by passing the following values   (the publisher id for this is ca-pub-5932155984517618 )


Following is the xml

Request

POST /api/adsense/v3/AccountService HTTP/1.0
Host: sandbox.google.com
User-Agent: NuSOAP/0.7.3 (1.114)
Content-Type: text/xml; charset=UTF-8
SOAPAction: "urn:createAccount"
Content-Length: 1130


<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:ns0="http://www.google.com/api/adsense/v3">
<SOAP-ENV:Header>
<developer_email>adsensed...@google.com
</developer_email>
<developer_password>Q6R3l6a483
</developer_password>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns1:createAccount
    xmlns:ns1="http://www.google.com/api/adsense/v3">
<loginEmail>talluri...@gmail.com
</loginEmail>
<entityType>
<value>Individual
</value>
</entityType>
<websiteUrl>http://www.indyarocks.com
</websiteUrl>
<websiteLocale>en
</websiteLocale>
<usersPreferredLocale>en_US
</usersPreferredLocale>
<emailPromotionPreferences>true
</emailPromotionPreferences>
<synServiceTypes>
<value>ContentAds
</value>
</synServiceTypes>
<developerUrl>code.google.com
</developerUrl>
<debug_zip>500016
</debug_zip>
<debug_phone>02616
</debug_phone>
<debug_association_type>NotAssociated
</debug_association_type>
</ns1:createAccount>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Response

HTTP/1.1 200 OK
Content-Type: text/xml; charset=UTF-8
Transfer-Encoding: chunked
Date: Wed, 07 Oct 2009 05:12:54 GMT
Expires: Wed, 07 Oct 2009 05:12:54 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
Server: GFE/2.0
X-XSS-Protection: 0


<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns:createAccountResponse
    xmlns:ns="http://www.google.com/api/adsense/v3">
<return>
<type>
<value>ContentAds
</value>
</type>
<id>ca-pub-5932155984517618
</id>
</return>
</ns:createAccountResponse>
</soapenv:Body>
</soapenv:Envelope>


Hope now i can assosiate this account wsith the developer site



2. Now i am trying to get the getAssociationStatus

I am passing 'dummy' as the param to the $client->call('getAssociationStatus', $param, ADSENSE_NAMESPACE);
Getting the same error as An internal error has occurred. Please retry your request. Any thing is wrong in calling function?

Request

POST /api/adsense/v3/AccountService HTTP/1.0
Host: sandbox.google.com
User-Agent: NuSOAP/0.7.3 (1.114)
Content-Type: text/xml; charset=UTF-8
SOAPAction: "urn:getAssociationStatus"
Content-Length: 574


<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:ns0="http://www.google.com/api/adsense/v3">
<SOAP-ENV:Header>
<developer_email>adsensed...@google.com
</developer_email>
<developer_password>Q6R3l6a483
</developer_password>
<client_id>ca-pub-5932155984517618
</client_id>
</SOAP-ENV:Header>
<SOAP-ENV:Body>dummy
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Response

HTTP/1.1 500 Internal Server Error
Content-Type: text/xml; charset=UTF-8
Transfer-Encoding: chunked
Date: Wed, 07 Oct 2009 05:29:12 GMT
Expires: Wed, 07 Oct 2009 05:29:12 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
Server: GFE/2.0
X-XSS-Protection: 0


<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server.generalException
</faultcode>
<faultstring>An internal error has occurred. Please retry your request.
</faultstring>
<detail>
<axis2ns198:AdSenseApiExceptionFault
    xmlns:axis2ns198="http://www.google.com/api/adsense/v3">
<AdSenseApiException>
<code>0
</code>
<internal>true
</internal>
<message>An internal error has occurred. Please retry your request.
</message>
<trigger>
</trigger>
<triggerDetails>
</triggerDetails>
</AdSenseApiException>
</axis2ns198:AdSenseApiExceptionFault>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>

Array ( [error] => An internal error has occurred. Please retry your request. )


3.  Now i can generate the ad code by using the same publisher id. 

Request

POST /api/adsense/v3/AdSenseForContentService HTTP/1.0
Host: sandbox.google.com
User-Agent: NuSOAP/0.7.3 (1.114)
Content-Type: text/xml; charset=UTF-8
SOAPAction: "urn:generateAdCode"
Content-Length: 1137


<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:ns0="http://www.google.com/api/adsense/v3">
<SOAP-ENV:Header>
<developer_email>adsensed...@google.com
</developer_email>
<developer_password>Q6R3l6a483
</developer_password>
<client_id>ca-pub-5932155984517618
</client_id>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns1:generateAdCode
    xmlns:ns1="http://www.google.com/api/adsense/v3">
<synServiceId>ca-pub-5932155984517618
</synServiceId>
<adStyle>
<name>demoStyle
</name>
<borderColor>#0000FF
</borderColor>
<backgroundColor>#FFFFFF
</backgroundColor>
<titleColor>#FF0000
</titleColor>
<textColor>#00FF00
</textColor>
<urlColor>#FFFF00
</urlColor>
</adStyle>
<adUnitType>
<value>TextOnly
</value>
</adUnitType>
<layout>
<value>728x90
</value>
</layout>
<isFramedPage type="xsd:boolean">false
</isFramedPage>
<channelName xsi:nil="true"/>
<cornerStyles>
<value>DEFAULT
</value>
</cornerStyles>
</ns1:generateAdCode>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Response

HTTP/1.1 500 Internal Server Error
Content-Type: text/xml; charset=UTF-8
Transfer-Encoding: chunked
Date: Wed, 07 Oct 2009 05:37:09 GMT
Expires: Wed, 07 Oct 2009 05:37:09 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
Server: GFE/2.0
X-XSS-Protection: 0


<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server.generalException
</faultcode>
<faultstring>An internal error has occurred. Please retry your request.
</faultstring>
<detail>
<axis2ns200:AdSenseApiExceptionFault
    xmlns:axis2ns200="http://www.google.com/api/adsense/v3">
<AdSenseApiException>
<code>0
</code>
<internal>true
</internal>
<message>An internal error has occurred. Please retry your request.
</message>
<trigger>
</trigger>
<triggerDetails>
</triggerDetails>
</AdSenseApiException>
</axis2ns200:AdSenseApiExceptionFault>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>


Thanks,
Talluri.

Google AdSense API Support Team

unread,
Oct 7, 2009, 6:13:51 PM10/7/09
to AdSense API Forum
Talluri,

1. debug_zip, debug_phone, and debug_association_type belong in the
header section of your request (as per
http://code.google.com/apis/adsense/developer/adsense_api_sandbox.html#requestheader),
and not in the body of the method call. For your createAccount call,
the header should look like this:
<SOAP-ENV:Header>
<developer_email>adsensed...@google.com</developer_email>
<developer_password>Q6R3l6a483</developer_password>
<debug_zip>500016</debug_zip>
<debug_phone>02616</debug_phone>
<debug_association_type>NotAssociated</debug_association_type>
</SOAP-ENV:Header>

2. Your SOAP body is wrong. You're completely missing the method
wrapper (to which "dummy" should be a sub-element). For reference, it
should look like this:
<SOAP-ENV:Body>
<getAssociationStatus>
<dummy/>
</getAssociationStatus>
</SOAP-ENV:Body>

3. You're missing the alternate and hostChannelNames params.
Additionally, you may have to fix the order of the parameters in your
adStyle element. It should go: backgroundColor, borderColor, name,
textColor, titleColor, urlColor in that order.

Cheers,
Wes

On Oct 6, 10:41 pm, Deepthi Pothu <talluri.ju...@gmail.com> wrote:
> Hello Team,
>
> These are the steps i am  following
> *
> 1. I have created one account by passing the following values   (the
> publisher id for this is ca-pub-5932155984517618 )*
>
> Following is the xml
>
> *Request*
>
> POST /api/adsense/v3/AccountService HTTP/1.0
> Host: sandbox.google.com
> User-Agent: NuSOAP/0.7.3 (1.114)
> Content-Type: text/xml; charset=UTF-8
> SOAPAction: "urn:createAccount"
> Content-Length: 1130
>
> <?xml version="1.0" encoding="UTF-8"?>
> <SOAP-ENV:Envelope
>     xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
>     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
>     xmlns:ns0="http://www.google.com/api/adsense/v3">
> <SOAP-ENV:Header>
> <developer_email>adsensedevelop...@google.com
> </developer_email>
> <developer_password>Q6R3l6a483
> </developer_password>
> </SOAP-ENV:Header>
> <SOAP-ENV:Body>
> <ns1:createAccount
>     xmlns:ns1="http://www.google.com/api/adsense/v3">
> <loginEmail>talluri12.ju...@gmail.com
> *Response*
> *2. Now i am trying to get the  getAssociationStatus*
>
>     I am passing 'dummy' as the param to the
> $client->call('getAssociationStatus', $param, ADSENSE_NAMESPACE);
>
> Getting the same error as *An internal error has occurred. Please retry your
> request.* Any thing is wrong in calling function?
>
> *Request*
>
> POST /api/adsense/v3/AccountService HTTP/1.0
> Host: sandbox.google.com
> User-Agent: NuSOAP/0.7.3 (1.114)
> Content-Type: text/xml; charset=UTF-8
> SOAPAction: "urn:getAssociationStatus"
> Content-Length: 574
>
> <?xml version="1.0" encoding="UTF-8"?>
> <SOAP-ENV:Envelope
>     xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
>     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
>     xmlns:ns0="http://www.google.com/api/adsense/v3">
> <SOAP-ENV:Header>
> <developer_email>adsensedevelop...@google.com
> </developer_email>
> <developer_password>Q6R3l6a483
> </developer_password>
> <client_id>ca-pub-5932155984517618
> </client_id>
> </SOAP-ENV:Header>
> <SOAP-ENV:Body>dummy
> </SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
>
> *Response*
> *3.  Now i can generate the ad code by using the same publisher id.  *
>
> *Request*
>
> POST /api/adsense/v3/AdSenseForContentService HTTP/1.0
> Host: sandbox.google.com
> User-Agent: NuSOAP/0.7.3 (1.114)
> Content-Type: text/xml; charset=UTF-8
> SOAPAction: "urn:generateAdCode"
> Content-Length: 1137
>
> <?xml version="1.0" encoding="UTF-8"?>
> <SOAP-ENV:Envelope
>     xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
>     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
>     xmlns:ns0="http://www.google.com/api/adsense/v3">
> <SOAP-ENV:Header>
> <developer_email>adsensedevelop...@google.com
> *Response*

Deepthi Pothu

unread,
Oct 8, 2009, 3:52:35 AM10/8/09
to adsen...@googlegroups.com
Hi,

Thanks for the immediate response.

Now i am able to create and assoisate with existing account.

Issues

1. Internal error is coming while testing getAssociationStatus. Please check the xml

Request


POST /api/adsense/v3/AccountService HTTP/1.0
Host: sandbox.google.com
User-Agent: NuSOAP/0.7.3 (1.114)
Content-Type: text/xml; charset=UTF-8
SOAPAction: "urn:getAssociationStatus"
Content-Length: 622



<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:ns0="http://www.google.com/api/adsense/v3">
<SOAP-ENV:Header>
<developer_email>adsensed...@google.com
</developer_email>
<developer_password>Q6R3l6a483
</developer_password>
<client_id>ca-pub-3525523788062180

</client_id>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<getAssociationStatus>
<dummy/>
</getAssociationStatus>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Response


HTTP/1.1 500 Internal Server Error
Content-Type: text/xml; charset=UTF-8
Transfer-Encoding: chunked
Date: Thu, 08 Oct 2009 06:34:31 GMT
Expires: Thu, 08 Oct 2009 06:34:31 GMT

Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
Server: GFE/2.0
X-XSS-Protection: 0


<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server.generalException
</faultcode>
<faultstring>An internal error has occurred. Please retry your request.
</faultstring>
<detail>
<axis2ns232:AdSenseApiExceptionFault
    xmlns:axis2ns232="http://www.google.com/api/adsense/v3">

<AdSenseApiException>
<code>0
</code>
<internal>true
</internal>
<message>An internal error has occurred. Please retry your request.
</message>
<trigger>
</trigger>
<triggerDetails>
</triggerDetails>
</AdSenseApiException>
</axis2ns232:AdSenseApiExceptionFault>

</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>


2. What should be the next step after assosation with existing account. Will the user get any confirmation email or developer can show that user ads?

Thanks,
Talluri

Google AdSense API Support Team

unread,
Oct 15, 2009, 4:56:58 PM10/15/09
to AdSense API Forum
Talluri,

1. I forgot to mention, you'll need to include namespaces with the
request, and it looks like the dummy element actually has to contain
an int (the docs seem to be wrong here). For completeness, this is a
working request:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns0="http://www.google.com/api/adsense/v3">
<SOAP-ENV:Header>
<developer_email>adsensed...@google.com</developer_email>
<developer_password>Q6R3l6a483</developer_password>
<client_id>ca-pub-3884105113316233</client_id>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns0:getAssociationStatus>
<dummy>0</dummy>
</ns0:getAssociationStatus>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


2. After the user associates himself, he will receive a confirmation
email with a link to approve the association. Before he accepts, your
association is in the PENDING state. You should be able to call
generateAdCode for him, but will be unable to call getApprovalStatus
until he switches your association to ACTIVE.

Cheers,
Wes

On Oct 8, 12:52 am, Deepthi Pothu <talluri.ju...@gmail.com> wrote:
> Hi,
>
> Thanks for the immediate response.
>
> Now i am able to create and assoisate with existing account.
>
> *Issues*
>
> *1. Internal error is coming while testing getAssociationStatus. Please
> check the xml *
>
> Request
>
> POST /api/adsense/v3/AccountService HTTP/1.0
> Host: sandbox.google.com
> User-Agent: NuSOAP/0.7.3 (1.114)
> Content-Type: text/xml; charset=UTF-8
> SOAPAction: "urn:getAssociationStatus"
> Content-Length: 622
>
> <?xml version="1.0" encoding="UTF-8"?>
> <SOAP-ENV:Envelope
>     xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
>     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
>     xmlns:ns0="http://www.google.com/api/adsense/v3">
> <SOAP-ENV:Header>
> <developer_email>adsensedevelop...@google.com
> </developer_email>
> <developer_password>Q6R3l6a483
> </developer_password>
> >http://code.google.com/apis/adsense/developer/adsense_api_sandbox.htm...
> > ),
> > and not in the body of the method call.  For your createAccount call,
> > the header should look like this:
> > <SOAP-ENV:Header>
> ...
>
> read more »

talluri

unread,
Oct 19, 2009, 3:03:16 AM10/19/09
to AdSense API Forum
Wes,

Thanks for the reply. Its working fine. Now i am able to get the
assosiation and account status.

Now when i am trying to create a channel, internal error is coming.
Please check my xml and fix the issue

Request

POST /api/adsense/v3/ChannelService HTTP/1.0
Host: sandbox.google.com
User-Agent: NuSOAP/0.7.3 (1.114)
Content-Type: text/xml; charset=UTF-8
SOAPAction: "urn:createChannel"
Content-Length: 845


<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns0="http://www.google.com/api/adsense/v3">
<SOAP-ENV:Header>
<developer_email>adsensed...@google.com
</developer_email>
<developer_password>Q6R3l6a483
</developer_password>
<client_id>ca-pub-7665619855189413
</client_id>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns1:createChannel
xmlns:ns1="http://www.google.com/api/adsense/v3">
<status>
<value>Active
</value>
</status>
<type>
<value>Url
</value>
</type>
<name>
<value>indyarocks.com
</value>
</name>
<synServiceId>
<value>ca-pub-7665619855189413
</value>
</synServiceId>
<id>0
</id>
</ns1:createChannel>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


Response

HTTP/1.1 500 Internal Server Error
Content-Type: text/xml; charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 19 Oct 2009 06:05:11 GMT
Expires: Mon, 19 Oct 2009 06:05:11 GMT
On Oct 16, 1:56 am, Google AdSense API Support Team <adsenseapi-
supportt...@google.com> wrote:
> Talluri,
>
> 1.  I forgot to mention, you'll need to include namespaces with the
> request, and it looks like the dummy element actually has to contain
> an int (the docs seem to be wrong here).  For completeness, this is a
> working request:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <SOAP-ENV:Envelope
>     xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
>     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
>     xmlns:ns0="http://www.google.com/api/adsense/v3">
> <SOAP-ENV:Header>
> > On Thu, Oct 8, 2009 at 3:43 AM, GoogleAdSenseAPISupport Team <
> ...
>
> read more »

Google AdSense API Support Team

unread,
Oct 19, 2009, 2:33:08 PM10/19/09
to AdSense API Forum
Your method call is missing the <channel> element which should wrap
the other elements you've included--barring the method wrapper.
Additionally, name and synServiceId are not enumerated types, so they
do not require <value> tags. For completeness:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns0="http://www.google.com/api/adsense/v3">
<SOAP-ENV:Header>
<developer_email>adsensed...@google.com</developer_email>
<developer_password>Q6R3l6a483</developer_password>
<client_id>ca-pub-7665619855189413</client_id>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns1:createChannel
xmlns:ns1="http://www.google.com/api/adsense/v3">
<channel>
<id>0</id>
<name>indyarocks.com</name>
<status><value>Active</value></status>
<synServiceId>ca-pub-7665619855189413</synServiceId>
<type><value>Url</value></type>
</channel>
</ns1:createChannel>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Cheers,
Wes

On Oct 19, 12:03 am, talluri <talluri.ju...@gmail.com> wrote:
> Wes,
>
> Thanks for the reply. Its working fine. Now i am able to get the
> assosiation and account status.
>
> Now when i am  trying to create a channel, internal error is coming.
> Please check my xml and fix the issue
>
> Request
>
> POST /api/adsense/v3/ChannelService HTTP/1.0
> Host: sandbox.google.com
> User-Agent: NuSOAP/0.7.3 (1.114)
> Content-Type: text/xml; charset=UTF-8
> SOAPAction: "urn:createChannel"
> Content-Length: 845
>
> <?xml version="1.0" encoding="UTF-8"?>
> <SOAP-ENV:Envelope
>     xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
>     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
>     xmlns:ns0="http://www.google.com/api/adsense/v3">
> <SOAP-ENV:Header>
> ...
>
> read more »

Deepthi Pothu

unread,
Nov 24, 2009, 12:22:14 AM11/24/09
to adsen...@googlegroups.com
Hi Wes

1. Does the approval status of content ads and search ads are different for a same user (Suppose i have created an account with content ads and search ads). Whish client id should i pass to get approval status? Hope the same will apply for website locale and user preferred locale.

2. How can i test report service

Following are my request and response

Request

POST /api/adsense/v3/ReportService HTTP/1.0

Host: sandbox.google.com
User-Agent: NuSOAP/0.7.3 (1.114)
Content-Type: text/xml; charset=UTF-8
SOAPAction: "urn:generateReport"
Content-Length: 997



<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:ns0="http://www.google.com/api/adsense/v3">
<SOAP-ENV:Header>
<developer_email>adsensed...@google.com
</developer_email>
<developer_password>Q6R3l6a483
</developer_password>
<client_id>ca-pub-5674516007063616

</client_id>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns1:generateReport
    xmlns:ns1="http://www.google.com/api/adsense/v3">
<report xsi:type="ns2:AFCSiteReport"
    xmlns:ns4="http://www.google.com/api/adsense/v3">
<dateRange>
<startDate>
</startDate>
<endDate>
</endDate>
<isPredefined>true
</isPredefined>
<predefinedDateRange>
<value>AllTime
</value>
</predefinedDateRange>
</dateRange>
<outputFormat>
<value>CSV
</value>
</outputFormat>
<unit>
<value>Page
</value>
</unit>
</report>
</ns1:generateReport>

</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Response

HTTP/1.1 500 Internal Server Error
Content-Type: text/xml; charset=UTF-8
Transfer-Encoding: chunked
Date: Tue, 24 Nov 2009 05:18:16 GMT
Expires: Tue, 24 Nov 2009 05:18:16 GMT

Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
Server: GFE/2.0
X-XSS-Protection: 0


<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server.userException
</faultcode>
<faultstring>The publisher must be associated with the developer account before the developer can invoke operations on the publisher's account.
</faultstring>
<detail>
<axis2ns148:AdSenseApiExceptionFault
    xmlns:axis2ns148="http://www.google.com/api/adsense/v3">
<AdSenseApiException>
<code>113
</code>
<internal>false
</internal>
<message>The publisher must be associated with the developer account before the developer can invoke operations on the publisher's account.
</message>
<trigger>ca-pub-5674516007063616
</trigger>
<triggerDetails>
</triggerDetails>
</AdSenseApiException>
</axis2ns148:AdSenseApiExceptionFault>

</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>


Thanks,
Deepthi

> ...
>
> read more »
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AdSense API Forum" group.
To post to this group, send email to adsen...@googlegroups.com
To unsubscribe from this group, send email to adsense-api...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/adsense-api?hl=en
-~----------~----~----~----~------~----~------~--~---


Google AdSense API Support Team

unread,
Nov 25, 2009, 4:40:10 PM11/25/09
to AdSense API Forum
Approval status is account-wide. Client IDs for ContentAds and
SearchAds contain different prefixes, but are tied to the same
account. Using either will work for these calls, though the set of
possible website locales differs between ContentAds and SearchAds.

Regarding the report service, you're better off building and testing
that part of your implementation after the rest has gone live.
Unfortunately, the sandbox does not contain the necessary stats to
generate a report with any data in it.

Cheers,
Wes

On Nov 23, 9:22 pm, Deepthi Pothu <talluri.ju...@gmail.com> wrote:
> Hi Wes
>
> 1. Does the approval status of content ads and search ads are different for
> a same user (Suppose i have created an account with content ads and search
> ads). Whish client id should i pass to get approval status? Hope the same
> will apply for website locale and user preferred locale.
>
> *2. How can i test report service*
>
> Following are my request and response
>
> *Request*
>
> POST /api/adsense/v3/ReportService HTTP/1.0
> Host: sandbox.google.com
> User-Agent: NuSOAP/0.7.3 (1.114)
> Content-Type: text/xml; charset=UTF-8
> SOAPAction: "urn:generateReport"
> Content-Length: 997
>
> <?xml version="1.0" encoding="UTF-8"?>
> <SOAP-ENV:Envelope
>     xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
>     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
>     xmlns:ns0="http://www.google.com/api/adsense/v3">
> <SOAP-ENV:Header>
> <developer_email>adsensedevelop...@google.com
> </developer_email>
> <developer_password>Q6R3l6a483
> </developer_password>
> *Response*
> > > > > <developer_password>Q6R3l6a483...
>
> read more »
Reply all
Reply to author
Forward
0 new messages