$ wget 'https://www.googleapis.com/androidpublisher/v1/applications/com.myapp/subscriptions/myapp.month.test/purchases/subsubsubscripscription' --2013-02-11 18:24:01-- https://www.googleapis.com/androidpublisher/v1/applications/com.myapp/subscriptions/myapp.month.test/purchases/subsubsubscripscription Resolving www.googleapis.com (www.googleapis.com)... 173.194.71.95, 2a00:1450:4010:c04::5f Connecting to www.googleapis.com (www.googleapis.com)|173.194.71.95|:443... connected. HTTP request sent, awaiting response... 401 Unauthorized Authorization failed.
accounts.google.com/o/oauth2/auth?scope=https://www.googleapis.com/auth/androidpublisher
&response_type=code&access_type=offline
&redirect_uri=http://example.com/oauth2callback
&client_id=someclientid.apps.googleusercontent.com
example.com/oauth2callback?code=4/AuthoRIZ4ti0nC0De
$ wget https://accounts.google.com/o/oauth2/token --post-data 'code=4/AuthoRIZ4ti0nC0De&client_id=someclientid.apps.googleusercontent.com&client_secret=c1iEnT5eCReT&redirect_uri=http://example.com/oauth2callback&grant_type=authorization_code' -O - --2013-02-11 18:31:20-- https://accounts.google.com/o/oauth2/token Resolving accounts.google.com (accounts.google.com)... 173.194.71.84, 2a00:1450:4010:c04::54 Connecting to accounts.google.com (accounts.google.com)|173.194.71.84|:443... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [application/json] Saving to: `STDOUT' [<=> ] 0 --.-K/s { "access_token" : "ya29.ACCeSs-T0keN", "token_type" : "Bearer", "expires_in" : 3600, "refresh_token" : "1/rEfRE5hT0KeN" [ <=> ] 127 --.-K/s in 0s 2013-02-11 18:31:20 (16.6 MB/s) - written to stdout [127]
$ wget https://accounts.google.com/o/oauth2/token --post-data 'code=4/0thER-AuthoRIZ4ti0nC0De&client_id=someclientid.apps.googleusercontent.com&client_secret=c1iEnT5eCReT&redirect_uri=http://example.com/oauth2callback&grant_type=authorization_code' -O - --2013-02-11 18:31:20-- https://accounts.google.com/o/oauth2/token Resolving accounts.google.com (accounts.google.com)... 173.194.71.84, 2a00:1450:4010:c04::54 Connecting to accounts.google.com (accounts.google.com)|173.194.71.84|:443... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [application/json] Saving to: `STDOUT' [<=> ] 0 --.-K/s { "access_token" : "ya29.neW-ACCeSs-T0keN", "token_type" : "Bearer", "expires_in" : 3573, [ <=> ] 127 --.-K/s in 0s 2013-02-11 18:31:20 (16.6 MB/s) - written to stdout [127]
$ wget 'https://accounts.google.com/o/oauth2/token' --post-data 'refresh_token=1/rEfRE5hT0KeN&client_id=someclientid.apps.googleusercontent.com&client_secret=c1iEnT5eCReT&grant_type=refresh_token' -O - --2013-02-11 19:33:13-- https://accounts.google.com/o/oauth2/token Resolving accounts.google.com (accounts.google.com)... 173.194.71.84, 2a00:1450:4010:c04::54 Connecting to accounts.google.com (accounts.google.com)|173.194.71.84|:443... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [application/json] Saving to: `STDOUT' [<=> ] 0 --.-K/s { "access_token" : "ya29.rEFre5hED-ACCeSs-T0keN", "token_type" : "Bearer", "expires_in" : 3600 [ <=> ] 127 --.-K/s in 0s 2013-01-11 19:33:14 (18.7 MB/s) - written to stdout [127]
'refresh_token = $ wget 'https://accounts.google.com/o/oauth2/token' --post-data 'refresh_token=1/rEfRE5hT0KeN&client_id=someclientid.apps.googleusercontent.com&client_secret=c1iEnT5eCReT&grant_type=refresh_token' -O - --2013-02-11 19:33:13-- https://accounts.google.com/o/oauth2/token Resolving accounts.google.com (accounts.google.com)... 173.194.71.84, 2a00:1450:4010:c04::54 Connecting to accounts.google.com (accounts.google.com)|173.194.71.84|:443... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [application/json] Saving to: `STDOUT' [<=> ] 0 --.-K/s { "access_token" : "ya29.rEFre5hED-ACCeSs-T0keN", "token_type" : "Bearer", "expires_in" : 3600 [ <=> ] 127 --.-K/s in 0s 2013-01-11 19:33:14 (18.7 MB/s) - written to stdout [127]
= c1iEnT5eCReT & grant_type = refresh_token' -O - $ wget 'https://accounts.google.com/o/oauth2/token' --post-data 'refresh_token=1/rEfRE5hT0KeN&client_id=someclientid.apps.googleusercontent.com&client_secret=c1iEnT5eCReT&grant_type=refresh_token' -O - --2013-02-11 19:33:13-- https://accounts.google.com/o/oauth2/token Resolving accounts.google.com (accounts.google.com)... 173.194.71.84, 2a00:1450:4010:c04::54 Connecting to accounts.google.com (accounts.google.com)|173.194.71.84|:443... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [application/json] Saving to: `STDOUT' [<=> ] 0 --.-K/s { "access_token" : "ya29.rEFre5hED-ACCeSs-T0keN", "token_type" : "Bearer", "expires_in" : 3600 [ <=> ] 127 --.-K/s in 0s 2013-01-11 19:33:14 (18.7 MB/s) - written to stdout [127]
$ wget 'https://www.googleapis.com/androidpublisher/v1/applications/com.myapp/subscriptions/myapp.month.test/purchases/subsubsubscripscription?access_token=ya29.rEFre5hED-ACCeSs-T0keN' -O - --2013-02-11 19:50:21-- https://www.googleapis.com/androidpublisher/v1/applications/com.myapp/subscriptions/myapp.month.test/purchases/subsubsubscripscription?access_token=ya29.rEFre5hED-ACCeSs-T0keN Resolving www.googleapis.com (www.googleapis.com)... 173.194.71.95, 2a00:1450:4010:c04::5f Connecting to www.googleapis.com (www.googleapis.com)|173.194.71.95|:443... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [application/json] Saving to: `STDOUT' [<=> ] 0 --.-K/s { "kind": "androidpublisher#subscriptionPurchase", "initiationTimestampMsec": "1357909784285", "validUntilTimestampMsec": "1360588184285", "autoRenewing": true } [ <=> ] 167 --.-K/s in 0s 2013-02-11 19:50:21 (30.7 MB/s) - written to stdout [167]
$ wget 'https://www.googleapis.com/androidpublisher/v1/applications/com.myapp/subscriptions/not.myapp.month.test/purchases/subsubsubscripscription?access_token=ya29.rEFre5hED-ACCeSs-T0keN' -O - --2013-02-11 19:58:24-- https://www.googleapis.com/androidpublisher/v1/applications/com.myapp/subscriptions/not.myapp.month.test/purchases/subsubsubscripscription?access_token=ya29.rEFre5hED-ACCeSs-T0keN Resolving www.googleapis.com (www.googleapis.com)... 173.194.71.95, 2a00:1450:4010:c04::5f Connecting to www.googleapis.com (www.googleapis.com)|173.194.71.95|:443... connected. HTTP request sent, awaiting response... 400 Bad Request 2013-02-11 19:58:25 ERROR 400: Bad Request.
$ wget 'https://www.googleapis.com/androidpublisher/v1/applications/com.myapp/subscriptions/myapp.month.test/purchases/subsubsubscripscription/cancel?access_token=ya29.rEFre5hED-ACCeSs-T0keN' --post-data '' -O - --2013-02-11 20:01:16-- https://www.googleapis.com/androidpublisher/v1/applications/com.myapp/subscriptions/myapp.month.test/purchases/subsubsubscripscription/cancel?access_token=ya29.rEFre5hED-ACCeSs-T0keN Resolving www.googleapis.com (www.googleapis.com)... 173.194.71.95, 2a00:1450:4010:c04::5f Connecting to www.googleapis.com (www.googleapis.com)|173.194.71.95|:443... connected. HTTP request sent, awaiting response... 204 No Content
$ wget 'https://www.googleapis.com/androidpublisher/v1/applications/com.myapp/subscriptions/myapp.month.test/purchases/subsubsubscripscription?access_token=ya29.rEFre5hED-ACCeSs-T0keN' -O - --2013-02-11 20:08:47-- https://www.googleapis.com/androidpublisher/v1/applications/com.myapp/subscriptions/myapp.month.test/purchases/subsubsubscripscription?access_token=ya29.rEFre5hED-ACCeSs-T0keN Resolving www.googleapis.com (www.googleapis.com)... 173.194.71.95, 2a00:1450:4010:c04::5f Connecting to www.googleapis.com (www.googleapis.com)|173.194.71.95|:443... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [application/json] Saving to: `STDOUT' [<=> ] 0 --.-K/s { "kind": "androidpublisher#subscriptionPurchase", "initiationTimestampMsec": "1357909784285", "validUntilTimestampMsec": "1360588184285", "autoRenewing": false } [ <=> ] 167 --.-K/s in 0s 2013-02-11 20:08:49 (23.5 MB/s) - written to stdout [167]
Source: https://habr.com/ru/post/160911/
All Articles