|
List Info
Thread: AdWords API Can't run Ruby API sample code
|
|
| AdWords API Can't run Ruby API sample
code |

|
2007-12-19 00:26:40 |
I'm trying to get started with the API using the adwords4r
(11.0.3)
ruby gem. I'm running on win XT platform. I have the the
following
test program, which generates the provided exception output,
for the
given adwords.properties inputs (I have modified the file so
as not to
publish my actual credentials).
I have approved developer and application tokens. This is
my first
attempt to use the AdWords API.
Can anyone tell me what I'm doing wrong? Thanks!
Pauli
------------------------------------------------ sample code
(includes
additional 'requires' for other needs)
-----------------------
require 'rubygems'
require 'adwords4r'
require 'active_record'
require 'ruport'
require 'parseexcel'
require 'google'
require 'cgi'
adwords = AdWords::API.new
begin
puts "I'm before the new"
adwords = AdWords::API.new
puts "I'm after the new"
res = adwords.estimateKeywordList(
[AdWords::KeywordRequest.new(nil, 50000, false,
'flowers',
'Broad')]).estimateKeywordListReturn
puts "I'm after the soap call"
res.each {|c| puts dumpObj(c)}
puts "I'm after the each loop"
rescue AdWords::Error::UnknownAPICall => e
puts "in unknown API call exception block"
puts e
rescue AdWords::Error::ApiError => e
puts "in Adwords Error exception block"
puts e.code
puts e.message
end
------------------------------------------- end script
------------------------------------------------------------
----
------------------------------------------- output of run
------------------------------------------------------------
I'm before the new
I'm after the new
in Adwords Error exception block
nil
The requested version is not accessible.
------------------------------------------- end of run
output
-------------------------------------------------------
------------------------------------------- contents of
adwords.properties -----------------------------------
token=approved-developer-token
useragent=P playing with the API from ruby
password=myclientcenter-password
email=myclientcenter-login email
clientEmail=client email
applicationToken=approved-application-token
alternateUrl=https://s
andbox.google.com/api/adwords/v11/
------------------------------------------- end of
adwords.properties
------------------------------------------
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api googlegroups.com
To unsubscribe from this group, send email to
adwords-api-unsubscribe googlegroups.com
For more options, visit this group at http
://groups.google.com/group/adwords-api?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| AdWords API Re: Can't run Ruby API
sample code |

|
2007-12-19 13:29:06 |
Hello,
One immediate thing that I notice is that you are
specifying an
alternateUrl pointing to the Sandbox environment in your
adwords.properties file. That will cause the adwords4r to go
against
the Sandbox environment, which has a different set of
usernames and
tokens. This is fine for testing (and I'd recommend going
against the
Sandbox while you're developing your application so that you
don't
incur charges), but I just wanted to point out that you'd
need to
supply credentials as outlined here:
http://www.google.com/apis/adwords/develope
r/adwords_api_sandbox.html
If you're still experiencing problems, it would be helpful
if you
could post the SOAP request and response (though it looks
like you
might not be getting a response in your code), with all the
sensitive
login and token information X-ed out. If you set the
ADWORDS4R_DEBUG
environment variable to 'true' and before you run your code,
the SOAP
requests/responses will be logged to the current directory.
Cheers,
-Jeffrey Posnick, AdWords API Team
On Dec 19, 1:26 am, MarFarMa <margrymouse-newslett... yahoo.com>
wrote:
> I'm trying to get started with the API using the
adwords4r (11.0.3)
> ruby gem. I'm running on win XT platform. I have the
the following
> test program, which generates the provided exception
output, for the
> given adwords.properties inputs (I have modified the
file so as not to
> publish my actual credentials).
>
> I have approved developer and application tokens. This
is my first
> attempt to use the AdWords API.
>
> Can anyone tell me what I'm doing wrong? Thanks!
>
> Pauli
>
> ------------------------------------------------ sample
code (includes
> additional 'requires' for other needs)
-----------------------
> require 'rubygems'
> require 'adwords4r'
> require 'active_record'
> require 'ruport'
> require 'parseexcel'
> require 'google'
> require 'cgi'
>
> adwords = AdWords::API.new
>
> begin
> puts "I'm before the new"
>
> adwords = AdWords::API.new
>
> puts "I'm after the new"
>
> res = adwords.estimateKeywordList(
> [AdWords::KeywordRequest.new(nil, 50000, false,
'flowers',
> 'Broad')]).estimateKeywordListReturn
> puts "I'm after the soap call"
>
> res.each {|c| puts dumpObj(c)}
>
> puts "I'm after the each loop"
>
> rescue AdWords::Error::UnknownAPICall => e
> puts "in unknown API call exception
block"
> puts e
> rescue AdWords::Error::ApiError => e
> puts "in Adwords Error exception block"
> puts e.code
> puts e.message
> end
> ------------------------------------------- end script
>
------------------------------------------------------------
----
> ------------------------------------------- output of
run
>
------------------------------------------------------------
> I'm before the new
> I'm after the new
> in Adwords Error exception block
> nil
> The requested version is not accessible.
> ------------------------------------------- end of run
output
>
-------------------------------------------------------
> ------------------------------------------- contents
of
> adwords.properties -----------------------------------
> token=approved-developer-token
> useragent=P playing with the API from ruby
> password=myclientcenter-password
> email=myclientcenter-login email
> clientEmail=client email
> applicationToken=approved-application-token
> alternateUrl=https://s
andbox.google.com/api/adwords/v11/
> ------------------------------------------- end of
adwords.properties
> ------------------------------------------
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api googlegroups.com
To unsubscribe from this group, send email to
adwords-api-unsubscribe googlegroups.com
For more options, visit this group at http
://groups.google.com/group/adwords-api?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| AdWords API Re: Can't run Ruby API
sample code |

|
2007-12-19 22:24:16 |
(This is the OP posting from an alternate account)
OK -- I set the debug environment flag and credentials
consistent with
the sandbox, as pointed out, and it still doesn't make
sense. I don't
understand the appearance of titi example.com & toto example.com --
does this imply that the script didn't find the
adwords.properties
file? And why is it talking about version 12 when I provide
a URL
referencing version 11? The request doesn't seem to request
the
sandbox -- wasn't the alternateURL property supposed to
point it
against the test environment?
Hoping this makes some sense to you ....
Request:
<?xml version="1.0"
encoding="utf-8" ?>
- <env:Envelope xmlns sd=&q
uot;http://www.w3.
org/2001/XMLSchema"
xmlns:env="http:
//schemas.xmlsoap.org/soap/envelope/"
xmlns si=&q
uot;h
ttp://www.w3.org/2001/XMLSchema-instance">
- <env:Header>
<token
env:mustUnderstand="0">my_token</token>
<useragent env:mustUnderstand="0">P playing
with the API from ruby</
useragent>
<applicationToken env:mustUnderstand="0"
/>
<password
env:mustUnderstand="0">my_very_secret_password&
lt;/password>
<clientEmail
env:mustUnderstand="0">titi example.com</clientEmail>
<email env:mustUnderstand="0">toto example.com</email>
</env:Header>
- <env:Body>
- <n1:estimateKeywordList xmlns:n1="https://adwords.googl
e.com/api/
adwords/v11">
- <n1:keywordRequests>
<n1:maxCpc>50000</n1:maxCpc>
<n1:negative>false</n1:negative>
<n1:text>flowers</n1:text>
<n1:type>Broad</n1:type>
</n1:keywordRequests>
</n1:estimateKeywordList>
</env:Body>
</env:Envelope>
Result:
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlso
ap.org/soap/
envelope/" xmlns sd=&q
uot;http://www.w3.
org/2001/XMLSchema"
xmlns si=&q
uot;h
ttp://www.w3.org/2001/XMLSchema-instance">
- <soapenv:Body>
- <soapenv:Fault>
<faultcode>soapenv:Server.userException</faultcode&
gt;
<faultstring>The requested version is not
accessible.</faultstring>
- <detail>
- <ns1:fault xmlns:ns1="
https://adwords.google.com/api/adwords/v12">
<ns1:code>89</ns1:code>
<ns1:message>The requested version is not
accessible.</ns1:message>
<ns1:trigger>v12</ns1:trigger>
</ns1:fault>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
Thanks,
Pauli
On Dec 19, 2:29 pm, AdWords API Advisor
<adwordsapiadvi... google.com>
wrote:
> Hello,
>
> One immediate thing that I notice is that you are
specifying an
> alternateUrl pointing to the Sandbox environment in
your
> adwords.properties file. That will cause the adwords4r
to go against
> the Sandbox environment, which has a different set of
usernames and
> tokens. This is fine for testing (and I'd recommend
going against the
> Sandbox while you're developing your application so
that you don't
> incur charges), but I just wanted to point out that
you'd need to
> supply credentials as outlined here:
>
> http://www.google.com/apis/adwords/develope
r/adwords_api_sandbox.html
>
> If you're still experiencing problems, it would be
helpful if you
> could post the SOAP request and response (though it
looks like you
> might not be getting a response in your code), with all
the sensitive
> login and token information X-ed out. If you set the
ADWORDS4R_DEBUG
> environment variable to 'true' and before you run your
code, the SOAP
> requests/responses will be logged to the current
directory.
>
> Cheers,
> -Jeffrey Posnick, AdWords API Team
>
> On Dec 19, 1:26 am, MarFarMa
<margrymouse-newslett... yahoo.com>
> wrote:
>
> > I'm trying to get started with the API using the
adwords4r (11.0.3)
> > ruby gem. I'm running on win XT platform. I have
the the following
> > test program, which generates the provided
exception output, for the
> > given adwords.properties inputs (I have modified
the file so as not to
> > publish my actual credentials).
>
> > I have approved developer and application tokens.
This is my first
> > attempt to use the AdWords API.
>
> > Can anyone tell me what I'm doing wrong? Thanks!
>
> > Pauli
>
> > ------------------------------------------------
sample code (includes
> > additional 'requires' for other needs)
-----------------------
> > require 'rubygems'
> > require 'adwords4r'
> > require 'active_record'
> > require 'ruport'
> > require 'parseexcel'
> > require 'google'
> > require 'cgi'
>
> > adwords = AdWords::API.new
>
> > begin
> > puts "I'm before the new"
>
> > adwords = AdWords::API.new
>
> > puts "I'm after the new"
>
> > res = adwords.estimateKeywordList(
> > [AdWords::KeywordRequest.new(nil, 50000,
false, 'flowers',
> > 'Broad')]).estimateKeywordListReturn
> > puts "I'm after the soap call"
>
> > res.each {|c| puts dumpObj(c)}
>
> > puts "I'm after the each loop"
>
> > rescue AdWords::Error::UnknownAPICall => e
> > puts "in unknown API call exception
block"
> > puts e
> > rescue AdWords::Error::ApiError => e
> > puts "in Adwords Error exception
block"
> > puts e.code
> > puts e.message
> > end
> > ------------------------------------------- end
script
> >
------------------------------------------------------------
----
> > ------------------------------------------- output
of run
> >
------------------------------------------------------------
> > I'm before the new
> > I'm after the new
> > in Adwords Error exception block
> > nil
> > The requested version is not accessible.
> > ------------------------------------------- end of
run output
> >
-------------------------------------------------------
> > -------------------------------------------
contents of
> > adwords.properties
-----------------------------------
> > token=approved-developer-token
> > useragent=P playing with the API from ruby
> > password=myclientcenter-password
> > email=myclientcenter-login email
> > clientEmail=client email
> > applicationToken=approved-application-token
> > alternateUrl=https://s
andbox.google.com/api/adwords/v11/
> > ------------------------------------------- end of
adwords.properties
> > ------------------------------------------
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api googlegroups.com
To unsubscribe from this group, send email to
adwords-api-unsubscribe googlegroups.com
For more options, visit this group at http
://groups.google.com/group/adwords-api?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| AdWords API Re: Can't run Ruby API
sample code |

|
2007-12-19 22:32:07 |
OK -- mystery solved. I had a stray adwords.properties file
in c: --
and I was editing the one in the application working
directory.
Strangely enough, that was specified v6 of the api, and the
error
complained about version 12?????
Thanks,
Pauli
On Dec 19, 11:24 pm, Pauli <pauli.pr... gmail.com> wrote:
> (This is the OP posting from an alternate account)
>
> OK -- I set the debug environment flag and credentials
consistent with
> the sandbox, as pointed out, and it still doesn't make
sense. I don't
> understand the appearance of t... example.com & t... example.com --
> does this imply that the script didn't find the
adwords.properties
> file? And why is it talking about version 12 when I
provide a URL
> referencing version 11? The request doesn't seem to
request the
> sandbox -- wasn't the alternateURL property supposed to
point it
> against the test environment?
>
> Hoping this makes some sense to you ....
>
> Request:
>
> <?xml version="1.0"
encoding="utf-8" ?>
> - <env:Envelope xmlns sd=&q
uot;http://www.w3.
org/2001/XMLSchema"
> xmlns:env="http:
//schemas.xmlsoap.org/soap/envelope/"
> xmlns si=&q
uot;h
ttp://www.w3.org/2001/XMLSchema-instance">
> - <env:Header>
> <token
env:mustUnderstand="0">my_token</token>
> <useragent
env:mustUnderstand="0">P playing with the API from
ruby</
> useragent>
> <applicationToken env:mustUnderstand="0"
/>
> <password
env:mustUnderstand="0">my_very_secret_password&
lt;/password>
> <clientEmail
env:mustUnderstand="0">t... example.com</clientEmail>
> <email
env:mustUnderstand="0">t... example.com</email>
> </env:Header>
> - <env:Body>
> - <n1:estimateKeywordList xmlns:n1="https://adwords.googl
e.com/api/
> adwords/v11">
> - <n1:keywordRequests>
> <n1:maxCpc>50000</n1:maxCpc>
> <n1:negative>false</n1:negative>
> <n1:text>flowers</n1:text>
> <n1:type>Broad</n1:type>
> </n1:keywordRequests>
> </n1:estimateKeywordList>
> </env:Body>
> </env:Envelope>
>
> Result:
>
> - <soapenv:Envelope xmlns:soapenv="http://schemas.xmlso
ap.org/soap/
> envelope/" xmlns sd=&q
uot;http://www.w3.
org/2001/XMLSchema"
> xmlns si=&q
uot;h
ttp://www.w3.org/2001/XMLSchema-instance">
> - <soapenv:Body>
> - <soapenv:Fault>
>
<faultcode>soapenv:Server.userException</faultcode&
gt;
> <faultstring>The requested version is not
accessible.</faultstring>
> - <detail>
> - <ns1:fault xmlns:ns1="
https://adwords.google.com/api/adwords/v12">
> <ns1:code>89</ns1:code>
> <ns1:message>The requested version is not
accessible.</ns1:message>
> <ns1:trigger>v12</ns1:trigger>
> </ns1:fault>
> </detail>
> </soapenv:Fault>
> </soapenv:Body>
> </soapenv:Envelope>
>
> Thanks,
>
> Pauli
>
> On Dec 19, 2:29 pm, AdWords API Advisor
<adwordsapiadvi... google.com>
> wrote:
>
> > Hello,
>
> > One immediate thing that I notice is that you are
specifying an
> > alternateUrl pointing to the Sandbox environment
in your
> > adwords.properties file. That will cause the
adwords4r to go against
> > the Sandbox environment, which has a different set
of usernames and
> > tokens. This is fine for testing (and I'd
recommend going against the
> > Sandbox while you're developing your application
so that you don't
> > incur charges), but I just wanted to point out
that you'd need to
> > supply credentials as outlined here:
>
> > http://www.google.com/apis/adwords/develope
r/adwords_api_sandbox.html
>
> > If you're still experiencing problems, it would
be helpful if you
> > could post the SOAP request and response (though
it looks like you
> > might not be getting a response in your code),
with all the sensitive
> > login and token information X-ed out. If you set
the ADWORDS4R_DEBUG
> > environment variable to 'true' and before you run
your code, the SOAP
> > requests/responses will be logged to the current
directory.
>
> > Cheers,
> > -Jeffrey Posnick, AdWords API Team
>
> > On Dec 19, 1:26 am, MarFarMa
<margrymouse-newslett... yahoo.com>
> > wrote:
>
> > > I'm trying to get started with the API using
the adwords4r (11.0.3)
> > > ruby gem. I'm running on win XT platform. I
have the the following
> > > test program, which generates the provided
exception output, for the
> > > given adwords.properties inputs (I have
modified the file so as not to
> > > publish my actual credentials).
>
> > > I have approved developer and application
tokens. This is my first
> > > attempt to use the AdWords API.
>
> > > Can anyone tell me what I'm doing wrong?
Thanks!
>
> > > Pauli
>
> > >
------------------------------------------------ sample code
(includes
> > > additional 'requires' for other needs)
-----------------------
> > > require 'rubygems'
> > > require 'adwords4r'
> > > require 'active_record'
> > > require 'ruport'
> > > require 'parseexcel'
> > > require 'google'
> > > require 'cgi'
>
> > > adwords = AdWords::API.new
>
> > > begin
> > > puts "I'm before the new"
>
> > > adwords = AdWords::API.new
>
> > > puts "I'm after the new"
>
> > > res = adwords.estimateKeywordList(
> > > [AdWords::KeywordRequest.new(nil,
50000, false, 'flowers',
> > > 'Broad')]).estimateKeywordListReturn
> > > puts "I'm after the soap call"
>
> > > res.each {|c| puts dumpObj(c)}
>
> > > puts "I'm after the each loop"
>
> > > rescue AdWords::Error::UnknownAPICall =>
e
> > > puts "in unknown API call exception
block"
> > > puts e
> > > rescue AdWords::Error::ApiError => e
> > > puts "in Adwords Error exception
block"
> > > puts e.code
> > > puts e.message
> > > end
> > > -------------------------------------------
end script
> > >
------------------------------------------------------------
----
> > > -------------------------------------------
output of run
> > >
------------------------------------------------------------
> > > I'm before the new
> > > I'm after the new
> > > in Adwords Error exception block
> > > nil
> > > The requested version is not accessible.
> > > -------------------------------------------
end of run output
> > >
-------------------------------------------------------
> > > -------------------------------------------
contents of
> > > adwords.properties
-----------------------------------
> > > token=approved-developer-token
> > > useragent=P playing with the API from
ruby
> > > password=myclientcenter-password
> > > email=myclientcenter-login email
> > > clientEmail=client email
> > > applicationToken=approved-application-token
> > > alternateUrl=https://s
andbox.google.com/api/adwords/v11/
> > > -------------------------------------------
end of adwords.properties
> > > ------------------------------------------
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api googlegroups.com
To unsubscribe from this group, send email to
adwords-api-unsubscribe googlegroups.com
For more options, visit this group at http
://groups.google.com/group/adwords-api?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| AdWords API Re: Can't run Ruby API
sample code |

|
2007-12-20 13:56:23 |
Hello Pauli,
The v12 showing up there is fairly odd... but in any case,
I'm glad
the situation is sorted.
Cheers,
-Jeffrey Posnick, AdWords API Team
On Dec 19, 11:32 pm, Pauli <pauli.pr... gmail.com> wrote:
> OK -- mystery solved. I had a stray adwords.properties
file in c: --
> and I was editing the one in the application working
directory.
> Strangely enough, that was specified v6 of the api, and
the error
> complained about version 12?????
>
> Thanks,
>
> Pauli
>
> On Dec 19, 11:24 pm, Pauli <pauli.pr... gmail.com> wrote:
>
> > (This is the OP posting from an alternate
account)
>
> > OK -- I set the debug environment flag and
credentials consistent with
> > the sandbox, as pointed out, and it still doesn't
make sense. I don't
> > understand the appearance of t... example.com & t... example.com --
> > does this imply that the script didn't find the
adwords.properties
> > file? And why is it talking about version 12 when
I provide a URL
> > referencing version 11? The request doesn't seem
to request the
> > sandbox -- wasn't the alternateURL property
supposed to point it
> > against the test environment?
>
> > Hoping this makes some sense to you ....
>
> > Request:
>
> > <?xml version="1.0"
encoding="utf-8" ?>
> > - <env:Envelope xmlns sd=&q
uot;http://www.w3.
org/2001/XMLSchema"
> > xmlns:env="http:
//schemas.xmlsoap.org/soap/envelope/"
> > xmlns si=&q
uot;h
ttp://www.w3.org/2001/XMLSchema-instance">
> > - <env:Header>
> > <token
env:mustUnderstand="0">my_token</token>
> > <useragent
env:mustUnderstand="0">P playing with the API from
ruby</
> > useragent>
> > <applicationToken
env:mustUnderstand="0" />
> > <password
env:mustUnderstand="0">my_very_secret_password&
lt;/password>
> > <clientEmail
env:mustUnderstand="0">t... example.com</clientEmail>
> > <email
env:mustUnderstand="0">t... example.com</email>
> > </env:Header>
> > - <env:Body>
> > - <n1:estimateKeywordList xmlns:n1="https://adwords.googl
e.com/api/
> > adwords/v11">
> > - <n1:keywordRequests>
> > <n1:maxCpc>50000</n1:maxCpc>
> > <n1:negative>false</n1:negative>
> > <n1:text>flowers</n1:text>
> > <n1:type>Broad</n1:type>
> > </n1:keywordRequests>
> > </n1:estimateKeywordList>
> > </env:Body>
> > </env:Envelope>
>
> > Result:
>
> > - <soapenv:Envelope xmlns:soapenv="http://schemas.xmlso
ap.org/soap/
> > envelope/" xmlns sd=&q
uot;http://www.w3.
org/2001/XMLSchema"
> > xmlns si=&q
uot;h
ttp://www.w3.org/2001/XMLSchema-instance">
> > - <soapenv:Body>
> > - <soapenv:Fault>
> >
<faultcode>soapenv:Server.userException</faultcode&
gt;
> > <faultstring>The requested version is not
accessible.</faultstring>
> > - <detail>
> > - <ns1:fault xmlns:ns1="
https://adwords.google.com/api/adwords/v12">
> > <ns1:code>89</ns1:code>
> > <ns1:message>The requested version is not
accessible.</ns1:message>
> > <ns1:trigger>v12</ns1:trigger>
> > </ns1:fault>
> > </detail>
> > </soapenv:Fault>
> > </soapenv:Body>
> > </soapenv:Envelope>
>
> > Thanks,
>
> > Pauli
>
> > On Dec 19, 2:29 pm, AdWords API Advisor
<adwordsapiadvi... google.com>
> > wrote:
>
> > > Hello,
>
> > > One immediate thing that I notice is that
you are specifying an
> > > alternateUrl pointing to the Sandbox
environment in your
> > > adwords.properties file. That will cause the
adwords4r to go against
> > > the Sandbox environment, which has a
different set of usernames and
> > > tokens. This is fine for testing (and I'd
recommend going against the
> > > Sandbox while you're developing your
application so that you don't
> > > incur charges), but I just wanted to point
out that you'd need to
> > > supply credentials as outlined here:
>
> > > http://www.google.com/apis/adwords/develope
r/adwords_api_sandbox.html
>
> > > If you're still experiencing problems, it
would be helpful if you
> > > could post the SOAP request and response
(though it looks like you
> > > might not be getting a response in your
code), with all the sensitive
> > > login and token information X-ed out. If you
set the ADWORDS4R_DEBUG
> > > environment variable to 'true' and before you
run your code, the SOAP
> > > requests/responses will be logged to the
current directory.
>
> > > Cheers,
> > > -Jeffrey Posnick, AdWords API Team
>
> > > On Dec 19, 1:26 am, MarFarMa
<margrymouse-newslett... yahoo.com>
> > > wrote:
>
> > > > I'm trying to get started with the API
using the adwords4r (11.0.3)
> > > > ruby gem. I'm running on win XT
platform. I have the the following
> > > > test program, which generates the
provided exception output, for the
> > > > given adwords.properties inputs (I have
modified the file so as not to
> > > > publish my actual credentials).
>
> > > > I have approved developer and
application tokens. This is my first
> > > > attempt to use the AdWords API.
>
> > > > Can anyone tell me what I'm doing wrong?
Thanks!
>
> > > > Pauli
>
> > > >
------------------------------------------------ sample code
(includes
> > > > additional 'requires' for other needs)
-----------------------
> > > > require 'rubygems'
> > > > require 'adwords4r'
> > > > require 'active_record'
> > > > require 'ruport'
> > > > require 'parseexcel'
> > > > require 'google'
> > > > require 'cgi'
>
> > > > adwords = AdWords::API.new
>
> > > > begin
> > > > puts "I'm before the new"
>
> > > > adwords = AdWords::API.new
>
> > > > puts "I'm after the new"
>
> > > > res = adwords.estimateKeywordList(
> > > >
[AdWords::KeywordRequest.new(nil, 50000, false, 'flowers',
> > > > 'Broad')]).estimateKeywordListReturn
> > > > puts "I'm after the soap
call"
>
> > > > res.each {|c| puts dumpObj(c)}
>
> > > > puts "I'm after the each
loop"
>
> > > > rescue AdWords::Error::UnknownAPICall
=> e
> > > > puts "in unknown API call
exception block"
> > > > puts e
> > > > rescue AdWords::Error::ApiError => e
> > > > puts "in Adwords Error
exception block"
> > > > puts e.code
> > > > puts e.message
> > > > end
> > > >
------------------------------------------- end script
> > > >
------------------------------------------------------------
----
> > > >
------------------------------------------- output of run
> > > >
------------------------------------------------------------
> > > > I'm before the new
> > > > I'm after the new
> > > > in Adwords Error exception block
> > > > nil
> > > > The requested version is not
accessible.
> > > >
------------------------------------------- end of run
output
> > > >
-------------------------------------------------------
> > > >
------------------------------------------- contents of
> > > > adwords.properties
-----------------------------------
> > > > token=approved-developer-token
> > > > useragent=P playing with the API from
ruby
> > > > password=myclientcenter-password
> > > > email=myclientcenter-login email
> > > > clientEmail=client email
> > > >
applicationToken=approved-application-token
> > > > alternateUrl=https://s
andbox.google.com/api/adwords/v11/
> > > >
------------------------------------------- end of
adwords.properties
> > > >
------------------------------------------
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api googlegroups.com
To unsubscribe from this group, send email to
adwords-api-unsubscribe googlegroups.com
For more options, visit this group at http
://groups.google.com/group/adwords-api?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
[1-5]
|
|