Ok, so after some debugging I found solution and want to share it in
case someone gets same thing.

This is fault string I got for add campaign command:
OperationAccessDenied.ADD_OPERATION_NOT_PERMITTED

This is sandbox credentials before changes:
  SANDBOX_CREDS = {
    :authentication => {
      :method => 'ClientLogin',
      :developer_token => '[email protected]++USD',
      :user_agent => 'adwords_api',
      :password => 'PASS',
      :email => '[email protected]'
    },
    :service => {
      :environment => 'SANDBOX'
    }

To solve this problem I run ServicedAccountService.get and it returned
me client_id and I add this to
sandbox credentials.
@adwords = AdwordsApi::Api.new(creds)
@serv_acc_srv = @adwords.service(:ServicedAccountService, API_VERSION)
ser_acc_serv = @serv_acc_srv.get
ser_acc_serv - contains all client logins (5 of them) and customer
ids, also it contains client_id field.

New sandbox credentials:
  SANDBOX_CREDS = {
    :authentication => {
      :method => 'ClientLogin',
      :developer_token => '[email protected]++USD',
      :user_agent => 'adwords_api',
      :password => 'PASS',
      :email => '[email protected]',
      :client_customer_id => 'XXX-XXX-XXXX'
    },
    :service => {
      :environment => 'SANDBOX'
    }

And now I can add campaign to sandbox!

Regards,
Sinisa.

On Dec 5, 5:00 pm, sgrgic <[email protected]> wrote:
> Hi,
>
> I tried this 
> example:http://code.google.com/p/google-api-ads-ruby/source/browse/adwords_ap...
> but I can't add campaign to Sandbox.
> Here is output from Terminal:
>
>  =>
> {:operator=>"ADD", :operand=>{:status=>"PAUSED", 
> :budget=>{:amount=>{:micro_amount=>50000000}, :delivery_method=>"STANDARD", 
> :period=>"DAILY"}, :network_setting=>{:target_search_network=>true, 
> :target_content_network=>false, :target_content_contextual=>false, 
> :target_google_search=>true}, :bidding_strategy=>{:xsi_type=>"ManualCPC"}, 
> :name=>"Interplanetary
> Cruise #1323100655618"}}
> ree-1.8.7-2011.03 :033 > response = campaign_srv.mutate([operation])
> AdwordsApi::V201109::CampaignService::ApiException:
> AdwordsApi::V201109::CampaignService::ApiException
>         from /Users/sgrgic/.rvm/gems/ree-1.8.7-2011.03@DWR3/gems/google-ads-
> common-0.5.4/lib/ads_common/savon_service.rb:248:in `handle_errors'
>         from /Users/sgrgic/.rvm/gems/ree-1.8.7-2011.03@DWR3/gems/google-ads-
> common-0.5.4/lib/ads_common/savon_service.rb:86:in `execute_action'
>         from /Users/sgrgic/.rvm/gems/ree-1.8.7-2011.03@DWR3/gems/google-
> adwords-api-0.4.3/lib/adwords_api/v201109/campaign_service.rb:23:in
> `mutate'
>         from (irb):33
>
> Thanks,
> Sinisa.

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords 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

Reply via email to