Re: Error: redirect_uri_mismatch and Error: invalid_grant
It seems there is problem with GetRefreshToken.php (at least with the version we were using). So, Forget about execution of GetRefreshToken.php Instead, go to this URL : https://developers.google.com/oauthplayground/ Click on the SETTINGS icon on top right CHECK mark Use your own OAuth credentials Provide OAuth Client ID and OAuth Client Secret you have Click on close Next, on Step 1Select authorize APIs Fill the input box(the box with watermark text '*Input your own scopes*' with https://adwords.google.com/api/adwords/; Then, click on Authorize APIs Now, Step 2Exchange authorization code for tokens The above step will be populated with Authorization Code Again click on Exchange authorization code for tokens in the same step The required Refresh Token and Access Token gets populated The same can be used on your client applications to consume ADWORDS APIs Hope this works. If not, let me know with specifications, I will be glad to have a look. On Sat, Mar 28, 2015 at 11:21 PM, Akhmad Bayquni akhmad.bayq...@gmail.com wrote: Can i know what you do in case 1? I have same problem. And it my first time for using Adwords API. I need help. :) Pada Jumat, 10 Januari 2014 19.54.53 UTC+7, Doubt Dolson menulis: Hi, As we were trying to get API access, we did follow the following procedure but with only failure. We got error messages at two places while *1. Trying to get Authorization Code 'Error: redirect_uri_mismatch' 2. Trying to get Refresh Token 'Error: invalid_grant' * CASE # 1 : We have an active MCC account We are using Adwords PHP Client Library v201309 We have valid and approved developer token We have generated client_id and client_secret using URL : https://code.google.com/apis/console#access for Web Application We went to command line and executed GetRefreshToken.php We got URL to execute We executed ,we got error #1*'Error: redirect_uri_mismatch'* CASE # 2 : From case # 1, We got URL to execute We replaced redirect_uri manually by replacing with one of the urls defined as redirect urls during client id/secret generation We executed the modified URL We got an interface where it asked if we want to allow access to the application we defined We allowed *Clicked on allow button* We got an authorization code We supplied the same to the GetRefreshToken.php file as $code Again, we got an error *'Error: invalid_grant' * We are not able to move ahead from this point. So, any help would be appreciated. Note: With the same developer token, we are able to fetch data from a test MCC Account. Thanks, Deepak -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and Google+: https://googleadsdeveloper.blogspot.com/ https://plus.google.com/+GoogleAdsDevelopers/posts =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en --- You received this message because you are subscribed to a topic in the Google Groups AdWords API Forum group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/pv9y3nTI89s/unsubscribe. To unsubscribe from this group and all its topics, send an email to adwords-api+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/adwords-api. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/0ae076d5-8bb0-49f3-a0a5-905f712f08b3%40googlegroups.com https://groups.google.com/d/msgid/adwords-api/0ae076d5-8bb0-49f3-a0a5-905f712f08b3%40googlegroups.com?utm_medium=emailutm_source=footer . For more options, visit https://groups.google.com/d/optout. -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and Google+: https://googleadsdeveloper.blogspot.com/ https://plus.google.com/+GoogleAdsDevelopers/posts =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en --- You received this message because you are subscribed to the Google Groups AdWords API Forum group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/adwords-api. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/CADcCdwOFRn7AhK3L5g__E
Re: Error: redirect_uri_mismatch and Error: invalid_grant
Hi then the issue lies on the client creation specially in setting of redirect_url On Mon, Mar 30, 2015 at 1:01 PM, Akhmad Bayquni akhmad.bayq...@gmail.com wrote: Hi, thanks for the response. I've done what you mean, but the same problem comes even as the first step. I've been checking the Use your own OAuth credentials, i was provide OAuth Client ID and OAuth Client Secret where i have. I was fill the input box (the box with the watermark text 'Input your own scopes' with https://adwords.google.com/api/adwords/; and when I click Authorize APIs I redirected to the page with the error the same. 400. That's an error. Error: redirect_uri_mismatch The redirect URI in the request: https://developers.google.com/oauthplayground did not match a registered redirect URI. Just for info, i installed this on my localhost with xampp and phph 5.4. In the dashboard API I set JavaScript origins at: http://localhost:8700 and Redirect URIs with http://localhost:8700/ads (this is the folder where I put all the files adwords-examples-and-lib-5.8.2.tar.gz) Pada Senin, 30 Maret 2015 14.01.40 UTC+7, Doubt Dolson menulis: It seems there is problem with GetRefreshToken.php (at least with the version we were using). So, Forget about execution of GetRefreshToken.php Instead, go to this URL : https://developers.google.com/oauthplayground/ Click on the SETTINGS icon on top right CHECK mark Use your own OAuth credentials Provide OAuth Client ID and OAuth Client Secret you have Click on close Next, on Step 1Select authorize APIs Fill the input box(the box with watermark text '*Input your own scopes*' with https://adwords.google.com/api/adwords/; Then, click on Authorize APIs Now, Step 2Exchange authorization code for tokens The above step will be populated with Authorization Code Again click on Exchange authorization code for tokens in the same step The required Refresh Token and Access Token gets populated The same can be used on your client applications to consume ADWORDS APIs Hope this works. If not, let me know with specifications, I will be glad to have a look. On Sat, Mar 28, 2015 at 11:21 PM, Akhmad Bayquni akhmad@gmail.com wrote: Can i know what you do in case 1? I have same problem. And it my first time for using Adwords API. I need help. :) Pada Jumat, 10 Januari 2014 19.54.53 UTC+7, Doubt Dolson menulis: Hi, As we were trying to get API access, we did follow the following procedure but with only failure. We got error messages at two places while *1. Trying to get Authorization Code 'Error: redirect_uri_mismatch' 2. Trying to get Refresh Token 'Error: invalid_grant' * CASE # 1 : We have an active MCC account We are using Adwords PHP Client Library v201309 We have valid and approved developer token We have generated client_id and client_secret using URL : https://code.google.com/apis/console#access for Web Application We went to command line and executed GetRefreshToken.php We got URL to execute We executed ,we got error #1*'Error: redirect_uri_mismatch'* CASE # 2 : From case # 1, We got URL to execute We replaced redirect_uri manually by replacing with one of the urls defined as redirect urls during client id/secret generation We executed the modified URL We got an interface where it asked if we want to allow access to the application we defined We allowed *Clicked on allow button* We got an authorization code We supplied the same to the GetRefreshToken.php file as $code Again, we got an error *'Error: invalid_grant' * We are not able to move ahead from this point. So, any help would be appreciated. Note: With the same developer token, we are able to fetch data from a test MCC Account. Thanks, Deepak -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and Google+: https://googleadsdeveloper.blogspot.com/ https://plus.google.com/+GoogleAdsDevelopers/posts =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups AdWords API Forum group. To post to this group, send email to adwor...@googlegroups.com To unsubscribe from this group, send email to adwords-api...@googlegroups.com For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en --- You received this message because you are subscribed to a topic in the Google Groups AdWords API Forum group. To unsubscribe from this topic, visit https://groups.google.com/d/ topic/adwords-api/pv9y3nTI89s/unsubscribe. To unsubscribe from this group and all its topics, send an email to adwords-api...@googlegroups.com. Visit this group at http://groups.google.com/group/adwords-api. To view this discussion on the web visit https://groups.google.com/d/ msgid/adwords-api/0ae076d5-8bb0-49f3-a0a5-905f712f08b3% 40googlegroups.com https://groups.google.com/d
Re: Error: redirect_uri_mismatch and Error: invalid_grant
Hi Ray, Thank you very much for the reply. Yes, you guessed it right, we created an Web application client. In our case, it is not just multiple accounts under one MCC account but we have multiple MCC accounts. So, could you suggest us how we should go ahead in terms of authentication [OAuth2] like getting refresh tokens ? Let's say we have 10 MCC accounts and all those 10 contains multiple accounts under them. Regards, Deepak On Friday, January 17, 2014 1:48:17 AM UTC+5:30, Ray Tsang (AdWords API Team) wrote: Deepak, If you were able to get the OAuth Playground interface, it most likely means you have created an OAuth 2.0 Web application. This is perfectly fine if you plan to be able to operate on multiple user credentials. In most cases though, you may have a single top level MCC that manages the AdWords accounts. In which case, I would recommend you create an OAuth 2.0 Installed application to use with your PHP web application. Cheers, -- Ray Tsang (AdWords API Advisor) On Thursday, January 16, 2014 5:38:43 AM UTC-5, Doubt Dolson wrote: Hi Ray, I was not able to create with any type of client. But, I could get the refresh token using Oauth playground interface. Thank you. Deepak On Wednesday, January 15, 2014 12:26:02 AM UTC+5:30, Ray Tsang (AdWords API Team) wrote: Deepak, In your use case, I feel you should create a client ID / secret pair for Installed application. Please see our OAuth 2.0 authentication guidehttps://developers.google.com/adwords/api/docs/guides/authenticationfor more detail. Once you are using an Installed application - PHP's GetRefreshToken.php should work as expected. Thanks, -- Ray Tsang (AdWords API Advisor) On Friday, January 10, 2014 7:54:53 AM UTC-5, Doubt Dolson wrote: Hi, As we were trying to get API access, we did follow the following procedure but with only failure. We got error messages at two places while *1. Trying to get Authorization Code 'Error: redirect_uri_mismatch' 2. Trying to get Refresh Token 'Error: invalid_grant' * CASE # 1 : We have an active MCC account We are using Adwords PHP Client Library v201309 We have valid and approved developer token We have generated client_id and client_secret using URL : https://code.google.com/apis/console#access for Web Application We went to command line and executed GetRefreshToken.php We got URL to execute We executed ,we got error #1*'Error: redirect_uri_mismatch'* CASE # 2 : From case # 1, We got URL to execute We replaced redirect_uri manually by replacing with one of the urls defined as redirect urls during client id/secret generation We executed the modified URL We got an interface where it asked if we want to allow access to the application we defined We allowed *Clicked on allow button* We got an authorization code We supplied the same to the GetRefreshToken.php file as $code Again, we got an error *'Error: invalid_grant' * We are not able to move ahead from this point. So, any help would be appreciated. Note: With the same developer token, we are able to fetch data from a test MCC Account. Thanks, Deepak -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://googleadsdeveloper.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 adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en --- You received this message because you are subscribed to the Google Groups AdWords API Forum group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Error: redirect_uri_mismatch and Error: invalid_grant
Hi Ray, I was not able to create with any type of client. But, I could get the refresh token using Oauth playground interface. Thank you. Deepak On Wednesday, January 15, 2014 12:26:02 AM UTC+5:30, Ray Tsang (AdWords API Team) wrote: Deepak, In your use case, I feel you should create a client ID / secret pair for Installed application. Please see our OAuth 2.0 authentication guidehttps://developers.google.com/adwords/api/docs/guides/authenticationfor more detail. Once you are using an Installed application - PHP's GetRefreshToken.php should work as expected. Thanks, -- Ray Tsang (AdWords API Advisor) On Friday, January 10, 2014 7:54:53 AM UTC-5, Doubt Dolson wrote: Hi, As we were trying to get API access, we did follow the following procedure but with only failure. We got error messages at two places while *1. Trying to get Authorization Code 'Error: redirect_uri_mismatch' 2. Trying to get Refresh Token 'Error: invalid_grant' * CASE # 1 : We have an active MCC account We are using Adwords PHP Client Library v201309 We have valid and approved developer token We have generated client_id and client_secret using URL : https://code.google.com/apis/console#access for Web Application We went to command line and executed GetRefreshToken.php We got URL to execute We executed ,we got error #1*'Error: redirect_uri_mismatch'* CASE # 2 : From case # 1, We got URL to execute We replaced redirect_uri manually by replacing with one of the urls defined as redirect urls during client id/secret generation We executed the modified URL We got an interface where it asked if we want to allow access to the application we defined We allowed *Clicked on allow button* We got an authorization code We supplied the same to the GetRefreshToken.php file as $code Again, we got an error *'Error: invalid_grant' * We are not able to move ahead from this point. So, any help would be appreciated. Note: With the same developer token, we are able to fetch data from a test MCC Account. Thanks, Deepak -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://googleadsdeveloper.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 adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en --- You received this message because you are subscribed to the Google Groups AdWords API Forum group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: How to get started with AdWords API PHP library 4.7.0 / v201309 ?
This happens if : - auth.ini is not readable [Giving permission will solve it] - parse_ini_file function is not enabled [You can enable this funciton in php.ini file] - your path to auth.ini is not correct[You can echo the path on runtime and see if it is correct] Hopefully, one of the above resolves your issue. On Saturday, January 11, 2014 7:18:01 PM UTC+5:30, Ad_nu wrote: OK – I created a new client ID (with API console) and executed the file in command line (using shell client). Now I can see couple of error messages and URL. When I visit the URL I get error message: invalid_client no application name Errors that are displayed after the file is executed: Strict Standards: parse_ini_file(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CST/-6.0/no DST' instead in _MY_SERVER_PATH_/adwords_api/src/Google/Api/Ads/Common/Util/ApiPropertiesUtils.php on line 40 Warning: Error parsing _MY_SERVER_PATH_/adwords_api/src/Google/Api/Ads/AdWords/Lib/api.properties on line 15 in _MY_SERVER_PATH_/adwords_api/src/Google/Api/Ads/Common/Util/ApiPropertiesUtils.php on line 40 perjantai, 10. tammikuuta 2014 23.16.00 UTC+2 Josh Radcliff (AdWords API Team) kirjoitti: Hi, All of our examples (including the *GetRefreshToken.php*) are meant to be run from the command line. *GetRefreshToken.php* will write to stdout and prompt you to open a URL in your browser, then will wait on stdin for you to copy and paste the authorization code returned by the URL. Once you've done that it will print instructions for modifying your auth.ini to stdout. Are you running it from the command line or via some other mechanism? Thanks, Josh, AdWords API Team On Friday, January 10, 2014 12:05:35 PM UTC-5, Ad_nu wrote: OK – Thanks I’m still getting blank pages though… - I copied the developerToken from AdWords API center - I created the client_id and client_secret with API console But when I run the “GetRefreshToken.php” page is blank. Is this more of a server issue (at my end) – or is there other required information that I need to fill before I can get the refresh token? maanantai, 6. tammikuuta 2014 21.12.56 UTC+2 Josh Radcliff (AdWords API Team) kirjoitti: Hi, The sandbox endpoint was deprecated a while back in favor of test accounts. https://developers.google.com/adwords/api/docs/test-accounts Regarding simple tests, the GetCampaignshttps://github.com/googleads/googleads-php-lib/blob/master/examples/AdWords/v201309/BasicOperations/GetCampaigns.phpexample is a straightforward, read-only example that should indicate if you have everything set up correctly. Also, when you run the sample it will create log files in the current directory that you can check to confirm your request went through. Cheers, Josh, AdWords API Team On Sunday, January 5, 2014 6:47:37 AM UTC-5, Ad_nu wrote: I haven’t use AdWords API before – so I’m trying to get started with sandbox version. I Downloaded and installed the AdWords API PHP Client Library 4.7.0. to my server; I edited the user information in auth.ini and I also edited the settings.ini to use server: https://adwords-sandbox.google.com After these “configurations” all example files (under v201309) – like EstimateKeywordTraffic.php – return just a blank page (no API errors or PHP errors). What other configurations are required before I can make sandbox calls/requests? Are there any simple test files available (other than the files included in client library) that can be used for checking if my server actually made any API requests? -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://googleadsdeveloper.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 adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en --- You received this message because you are subscribed to the Google Groups AdWords API Forum group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Error: redirect_uri_mismatch and Error: invalid_grant
Hi, As we were trying to get API access, we did follow the following procedure but with only failure. We got error messages at two places while *1. Trying to get Authorization Code 'Error: redirect_uri_mismatch' 2. Trying to get Refresh Token 'Error: invalid_grant' * CASE # 1 : We have an active MCC account We are using Adwords PHP Client Library v201309 We have valid and approved developer token We have generated client_id and client_secret using URL : https://code.google.com/apis/console#access for Web Application We went to command line and executed GetRefreshToken.php We got URL to execute We executed ,we got error #1*'Error: redirect_uri_mismatch'* CASE # 2 : From case # 1, We got URL to execute We replaced redirect_uri manually by replacing with one of the urls defined as redirect urls during client id/secret generation We executed the modified URL We got an interface where it asked if we want to allow access to the application we defined We allowed *Clicked on allow button* We got an authorization code We supplied the same to the GetRefreshToken.php file as $code Again, we got an error *'Error: invalid_grant' * We are not able to move ahead from this point. So, any help would be appreciated. Note: With the same developer token, we are able to fetch data from a test MCC Account. Thanks, Deepak -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://googleadsdeveloper.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 adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en --- You received this message because you are subscribed to the Google Groups AdWords API Forum group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.