Sample Calls
Sample Direct Calls using HTTPS and Basic Authentication
Create access token
curl -v -d '{"id":1,"method":"oauth2.createAccessToken","params":{"service_key":"m9f5kyzfjjrssz6d5sfkbuw3","client":{"client_id":"yq7chp6ufkeea587gp6wqa6x","client_secret":"Azn4Xa"},"token_data":{"grant_type":"implicit"},"uri":{"redirect_uri":"https://some.com/cb"},"user_context":"testUser1455730448397"},"jsonrpc":"2.0"}' 'https://x.x.57.97:8083/v3/json-rpc' -u root:changeme -k * Trying x.x.57.97... * Connected to x.x.57.97 (x.x.57.97) port 8083 (#0) * found 148 certificates in /etc/ssl/certs/ca-certificates.crt * found 592 certificates in /etc/ssl/certs * ALPN, offering http/1.1 * SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256 * server certificate verification SKIPPED * server certificate status verification SKIPPED * common name: api.example.com (does not match 'x.x.57.97') * server certificate expiration date OK * server certificate activation date OK * certificate public key: RSA * certificate version: #3 * subject: C=defC,ST=defST,L=defL,O=defO,OU=defOU,CN=api.example.com * start date: Wed, 14 Nov 2018 03:28:23 GMT * expire date: Fri, 21 Oct 2118 03:28:23 GMT * issuer: C=defC,ST=defST,L=defL,O=defO,OU=defOU,CN=api.example.com * compression: NULL * ALPN, server did not agree to a protocol * Server auth using Basic with user 'root' > POST /v3/json-rpc HTTP/1.1 > Host: x.x.57.97:8083 > Authorization: Basic cm9vdDpjaGFuZ2VtZQ== > User-Agent: curl/7.47.0 > Accept: */* > Content-Length: 310 > Content-Type: application/x-www-form-urlencoded > * upload completely sent off: 310 out of 310 bytes < HTTP/1.1 200 OK < Content-Type: application/json;charset=UTF-8 < Cache-Control: no-store < Content-Length: 231 < Server: Jetty(8.1.3.v20120522) < * Connection #0 to host x.x.57.97 left intact {"jsonrpc":"2.0","id":1,"result":{"token_type":"bearer","return_type":"json","access_token":"q3nxsetjry582yhq2ej3xa7j","expires_in":36000,"scope":null,"user_context":"testUser1455730448397","uri":null,"extended":null,"state":null}
Create authorization code
curl -v -d '{ "id":1,"method":"oauth2.createAuthorizationCode","params":{"service_key":"m9f5kyzfjjrssz6d5sfkbuw3","client":{"client_id":"yq7chp6ufkeea587gp6wqa6x"},"response_type":"code","uri":{"redirect_uri":"https://some.com/cb"},"user_context": "testUser1455730448397"},"jsonrpc":"2.0"}' 'https://x.x.57.97:8083/v3/json-rpc' -u root:changeme -k * Trying x.x.57.97... * Connected to x.x.57.97 (x.x.57.97) port 8083 (#0) * found 148 certificates in /etc/ssl/certs/ca-certificates.crt * found 592 certificates in /etc/ssl/certs * ALPN, offering http/1.1 * SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256 * server certificate verification SKIPPED * server certificate status verification SKIPPED * common name: api.example.com (does not match 'x.x.57.97') * server certificate expiration date OK * server certificate activation date OK * certificate public key: RSA * certificate version: #3 * subject: C=defC,ST=defST,L=defL,O=defO,OU=defOU,CN=api.example.com * start date: Wed, 14 Nov 2018 03:28:23 GMT * expire date: Fri, 21 Oct 2118 03:28:23 GMT * issuer: C=defC,ST=defST,L=defL,O=defO,OU=defOU,CN=api.example.com * compression: NULL * ALPN, server did not agree to a protocol * Server auth using Basic with user 'root' > POST /v3/json-rpc HTTP/1.1 > Host: x.x.57.97:8083 > Authorization: Basic cm9vdDpjaGFuZ2VtZQ== > User-Agent: curl/7.47.0 > Accept: */* > Content-Length: 277 > Content-Type: application/x-www-form-urlencoded > * upload completely sent off: 277 out of 277 bytes < HTTP/1.1 200 OK < Content-Type: application/json;charset=UTF-8 < Cache-Control: no-store < Content-Length: 168 < Server: Jetty(8.1.3.v20120522) < * Connection #0 to host x.x.57.97 left intact {"jsonrpc":"2.0","id":1,"result":{"code":"33benr9fb9vah3g8ys7scmh5","uri":{"redirect_uri":"https://some.com/cb?code=33benr9fb9vah3g8ys7scmh5","state":""}},"error":null}
Create access token with authorization code
curl -v -d '{"id":1,"method":"oauth2.createAccessToken","params":{"service_key":"m9f5kyzfjjrssz6d5sfkbuw3","client":{"client_id":"yq7chp6ufkeea587gp6wqa6x","client_secret":"Azn4Xa"},"token_data":{"grant_type":"authorization_code","code":"33benr9fb9vah3g8ys7scmh5","scope":"scope1"},"uri":{"redirect_uri":"https://some.com/cb"},"user_context": "testUser1455730448397"},"jsonrpc":"2.0"}' 'https://x.x.57.97:8083/v3/json-rpc' -u root:changeme -k * Trying x.x.57.97... * Connected to x.x.57.97 (x.x.57.97) port 8083 (#0) * found 148 certificates in /etc/ssl/certs/ca-certificates.crt * found 592 certificates in /etc/ssl/certs * ALPN, offering http/1.1 * SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256 * server certificate verification SKIPPED * server certificate status verification SKIPPED * common name: api.example.com (does not match 'x.x.57.97') * server certificate expiration date OK * server certificate activation date OK * certificate public key: RSA * certificate version: #3 * subject: C=defC,ST=defST,L=defL,O=defO,OU=defOU,CN=api.example.com * start date: Wed, 14 Nov 2018 03:28:23 GMT * expire date: Fri, 21 Oct 2118 03:28:23 GMT * issuer: C=defC,ST=defST,L=defL,O=defO,OU=defOU,CN=api.example.com * compression: NULL * ALPN, server did not agree to a protocol * Server auth using Basic with user 'root' > POST /v3/json-rpc HTTP/1.1 > Host: x.x.57.97:8083 > Authorization: Basic cm9vdDpjaGFuZ2VtZQ== > User-Agent: curl/7.47.0 > Accept: */* > Content-Length: 372 > Content-Type: application/x-www-form-urlencoded > * upload completely sent off: 372 out of 372 bytes < HTTP/1.1 200 OK < Content-Type: application/json;charset=UTF-8 < Cache-Control: no-store < Content-Length: 274 < Server: Jetty(8.1.3.v20120522) < * Connection #0 to host x.x.57.97 left intact {"jsonrpc":"2.0","id":1,"result":{"token_type":"bearer","return_type":"json","access_token":"s4b7qs24qfns2m3ecjmuvgh4","expires_in":36000,"refresh_token":"xekntywdyp2hg7yvfbaxac5g","scope":null,"user_context":"testUser1455730448397","uri":null,"extended":null,"state":null}}
Update access token
curl -v -d '{"id":1,"method":"oauth2.updateAccessToken","params":{"service_key":"m9f5kyzfjjrssz6d5sfkbuw3","client":{"client_id":"yq7chp6ufkeea587gp6wqa6x","client_secret":"Azn4Xa"}, "access_token":"s4b7qs24qfns2m3ecjmuvgh4","user_context":"testUser1455730448397", "expires_in":600},"jsonrpc":"2.0"}' 'https://x.x.57.97:8083/v3/json-rpc' -u root:changeme -k * Trying x.x.57.97... * Connected to x.x.57.97 (x.x.57.97) port 8083 (#0) * found 148 certificates in /etc/ssl/certs/ca-certificates.crt * found 592 certificates in /etc/ssl/certs * ALPN, offering http/1.1 * SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256 * server certificate verification SKIPPED * server certificate status verification SKIPPED * common name: api.example.com (does not match 'x.x.57.97') * server certificate expiration date OK * server certificate activation date OK * certificate public key: RSA * certificate version: #3 * subject: C=defC,ST=defST,L=defL,O=defO,OU=defOU,CN=api.example.com * start date: Wed, 14 Nov 2018 03:28:23 GMT * expire date: Fri, 21 Oct 2118 03:28:23 GMT * issuer: C=defC,ST=defST,L=defL,O=defO,OU=defOU,CN=api.example.com * compression: NULL * ALPN, server did not agree to a protocol * Server auth using Basic with user 'root' > POST /v3/json-rpc HTTP/1.1 > Host: x.x.57.97:8083 > Authorization: Basic cm9vdDpjaGFuZ2VtZQ== > User-Agent: curl/7.47.0 > Accept: */* > Content-Length: 287 > Content-Type: application/x-www-form-urlencoded > * upload completely sent off: 287 out of 287 bytes < HTTP/1.1 200 OK < Content-Type: application/json;charset=UTF-8 < Cache-Control: no-store < Content-Length: 322 < Server: Jetty(8.1.3.v20120522) < * Connection #0 to host x.x.57.97 left intact {"jsonrpc":"2.0","id":1,"result":{"token_type":"bearer","access_token":"s4b7qs24qfns2m3ecjmuvgh4","expires":"2018-11-21T10:57:43Z","refresh_token_expires":1542765336403,"scope":null,"user_context":"testUser1455730448397","uri":null,"grant_type":"authorization_code","client_id":"yq7chp6ufkeea587gp6wqa6x","extended":null}}
Fetch access token
curl -v -d '{"id": 1,"jsonrpc":"2.0","method": "oauth2.fetchAccessToken","params": {"service_key":"m9f5kyzfjjrssz6d5sfkbuw3","access_token": "s4b7qs24qfns2m3ecjmuvgh4"}}' 'https://x.x.57.97:8083/v3/json-rpc' -u root:changeme -k * Trying x.x.57.97... * Connected to x.x.57.97 (x.x.57.97) port 8083 (#0) * found 148 certificates in /etc/ssl/certs/ca-certificates.crt * found 592 certificates in /etc/ssl/certs * ALPN, offering http/1.1 * SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256 * server certificate verification SKIPPED * server certificate status verification SKIPPED * common name: api.example.com (does not match 'x.x.57.97') * server certificate expiration date OK * server certificate activation date OK * certificate public key: RSA * certificate version: #3 * subject: C=defC,ST=defST,L=defL,O=defO,OU=defOU,CN=api.example.com * start date: Wed, 14 Nov 2018 03:28:23 GMT * expire date: Fri, 21 Oct 2118 03:28:23 GMT * issuer: C=defC,ST=defST,L=defL,O=defO,OU=defOU,CN=api.example.com * compression: NULL * ALPN, server did not agree to a protocol * Server auth using Basic with user 'root' > POST /v3/json-rpc HTTP/1.1 > Host: x.x.57.97:8083 > Authorization: Basic cm9vdDpjaGFuZ2VtZQ== > User-Agent: curl/7.47.0 > Accept: */* > Content-Length: 157 > Content-Type: application/x-www-form-urlencoded > * upload completely sent off: 157 out of 157 bytes < HTTP/1.1 200 OK < Content-Type: application/json;charset=UTF-8 < Cache-Control: no-store < Content-Length: 242 < Server: Jetty(8.1.3.v20120522) < * Connection #0 to host x.x.57.97 left intact {"jsonrpc":"2.0","id":1,"result":{"token_type":"bearer","expires":"2018-11-21T10:57:43Z","scope":null,"user_context":"testUser1455730448397","uri":null,"grant_type":"authorization_code","client_id":"yq7chp6ufkeea587gp6wqa6x","extended":null}}
Fetch application
curl -v -d '{"id": 1,"jsonrpc":"2.0","method":"oauth2.fetchApplication","params":{"service_key":"m9f5kyzfjjrssz6d5sfkbuw3","client":{"client_id":"yq7chp6ufkeea587gp6wqa6x","client_secret":"Azn4Xa"}}}' 'https://x.x.57.97:8083/v3/json-rpc' -u root:changeme -k * Trying x.x.57.97... * Connected to x.x.57.97 (x.x.57.97) port 8083 (#0) * found 148 certificates in /etc/ssl/certs/ca-certificates.crt * found 592 certificates in /etc/ssl/certs * ALPN, offering http/1.1 * SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256 * server certificate verification SKIPPED * server certificate status verification SKIPPED * common name: api.example.com (does not match 'x.x.57.97') * server certificate expiration date OK * server certificate activation date OK * certificate public key: RSA * certificate version: #3 * subject: C=defC,ST=defST,L=defL,O=defO,OU=defOU,CN=api.example.com * start date: Wed, 14 Nov 2018 03:28:23 GMT * expire date: Fri, 21 Oct 2118 03:28:23 GMT * issuer: C=defC,ST=defST,L=defL,O=defO,OU=defOU,CN=api.example.com * compression: NULL * ALPN, server did not agree to a protocol * Server auth using Basic with user 'root' > POST /v3/json-rpc HTTP/1.1 > Host: x.x.57.97:8083 > Authorization: Basic cm9vdDpjaGFuZ2VtZQ== > User-Agent: curl/7.47.0 > Accept: */* > Content-Length: 187 > Content-Type: application/x-www-form-urlencoded > * upload completely sent off: 187 out of 187 bytes < HTTP/1.1 200 OK < Content-Type: application/json;charset=UTF-8 < Cache-Control: no-store < Content-Length: 82 < Server: Jetty(8.1.3.v20120522) < * Connection #0 to host x.x.57.97 left intact {"jsonrpc":"2.0","id":1,"result":{"id":251547,"name":"TestOAuthRegisterCallBack"}}
Fetch user application
curl -v -d '{ "id":1, "method":"oauth2.fetchUserApplications", "params":{ "service_key":"m9f5kyzfjjrssz6d5sfkbuw3", "user_context":"testUser1455730448397" },"jsonrpc":"2.0"}' 'https://x.x.57.97:8083/v3/json-rpc' -u root:changeme -k * Trying x.x.57.97... * Connected to x.x.57.97 (x.x.57.97) port 8083 (#0) * found 148 certificates in /etc/ssl/certs/ca-certificates.crt * found 592 certificates in /etc/ssl/certs * ALPN, offering http/1.1 * SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256 * server certificate verification SKIPPED * server certificate status verification SKIPPED * common name: api.example.com (does not match 'x.x.57.97') * server certificate expiration date OK * server certificate activation date OK * certificate public key: RSA * certificate version: #3 * subject: C=defC,ST=defST,L=defL,O=defO,OU=defOU,CN=api.example.com * start date: Wed, 14 Nov 2018 03:28:23 GMT * expire date: Fri, 21 Oct 2118 03:28:23 GMT * issuer: C=defC,ST=defST,L=defL,O=defO,OU=defOU,CN=api.example.com * compression: NULL * ALPN, server did not agree to a protocol * Server auth using Basic with user 'root' > POST /v3/json-rpc HTTP/1.1 > Host: x.x.57.97:8083 > Authorization: Basic cm9vdDpjaGFuZ2VtZQ== > User-Agent: curl/7.47.0 > Accept: */* > Content-Length: 162 > Content-Type: application/x-www-form-urlencoded > * upload completely sent off: 162 out of 162 bytes < HTTP/1.1 200 OK < Content-Type: application/json;charset=UTF-8 < Cache-Control: no-store < Content-Length: 195 < Server: Jetty(8.1.3.v20120522) < * Connection #0 to host x.x.57.97 left intact {"jsonrpc":"2.0","id":1,"result":[{"id":251547,"name":"TestOAuthRegisterCallBack","access_tokens":["s4b7qs24qfns2m3ecjmuvgh4","q3nxsetjry582yhq2ej3xa7j"],"client_id":"yq7chp6ufkeea587gp6wqa6x"}]}
Revoke access token
curl -v -d '{ "id":1, "method":"oauth2.revokeAccessToken", "params":{ "service_key":"m9f5kyzfjjrssz6d5sfkbuw3", "client": { "client_id":"yq7chp6ufkeea587gp6wqa6x", "client_secret":"Azn4Xa" }, "access_token":"s4b7qs24qfns2m3ecjmuvgh4" },"jsonrpc":"2.0"}' 'https://x.x.57.97:8083/v3/json-rpc' -u root:changeme -k * Trying x.x.57.97... * Connected to x.x.57.97 (x.x.57.97) port 8083 (#0) * found 148 certificates in /etc/ssl/certs/ca-certificates.crt * found 592 certificates in /etc/ssl/certs * ALPN, offering http/1.1 * SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256 * server certificate verification SKIPPED * server certificate status verification SKIPPED * common name: api.example.com (does not match 'x.x.57.97') * server certificate expiration date OK * server certificate activation date OK * certificate public key: RSA * certificate version: #3 * subject: C=defC,ST=defST,L=defL,O=defO,OU=defOU,CN=api.example.com * start date: Wed, 14 Nov 2018 03:28:23 GMT * expire date: Fri, 21 Oct 2118 03:28:23 GMT * issuer: C=defC,ST=defST,L=defL,O=defO,OU=defOU,CN=api.example.com * compression: NULL * ALPN, server did not agree to a protocol * Server auth using Basic with user 'root' > POST /v3/json-rpc HTTP/1.1 > Host: x.x.57.97:8083 > Authorization: Basic cm9vdDpjaGFuZ2VtZQ== > User-Agent: curl/7.47.0 > Accept: */* > Content-Length: 240 > Content-Type: application/x-www-form-urlencoded > * upload completely sent off: 240 out of 240 bytes < HTTP/1.1 200 OK < Content-Type: application/json;charset=UTF-8 < Cache-Control: no-store < Content-Length: 38 < Server: Jetty(8.1.3.v20120522) < * Connection #0 to host x.x.57.97 left intact {"jsonrpc":"2.0","id":1,"result":true}
Revoke user application
curl -v -d '{ "id":1, "method":"oauth2.revokeUserApplication", "params":{ "service_key":"m9f5kyzfjjrssz6d5sfkbuw3", "client": { "client_id":"yq7chp6ufkeea587gp6wqa6x", "client_secret":"Azn4Xa" }, "user_context":"testUser1455730448397" },"jsonrpc":"2.0"}' 'https://x.x.57.97:8083/v3/json-rpc' -u root:changeme -k * Trying x.x.57.97... * Connected to x.x.57.97 (x.x.57.97) port 8083 (#0) * found 148 certificates in /etc/ssl/certs/ca-certificates.crt * found 592 certificates in /etc/ssl/certs * ALPN, offering http/1.1 * SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256 * server certificate verification SKIPPED * server certificate status verification SKIPPED * common name: api.example.com (does not match 'x.x.57.97') * server certificate expiration date OK * server certificate activation date OK * certificate public key: RSA * certificate version: #3 * subject: C=defC,ST=defST,L=defL,O=defO,OU=defOU,CN=api.example.com * start date: Wed, 14 Nov 2018 03:28:23 GMT * expire date: Fri, 21 Oct 2118 03:28:23 GMT * issuer: C=defC,ST=defST,L=defL,O=defO,OU=defOU,CN=api.example.com * compression: NULL * ALPN, server did not agree to a protocol * Server auth using Basic with user 'root' > POST /v3/json-rpc HTTP/1.1 > Host: x.x.57.97:8083 > Authorization: Basic cm9vdDpjaGFuZ2VtZQ== > User-Agent: curl/7.47.0 > Accept: */* > Content-Length: 241 > Content-Type: application/x-www-form-urlencoded > * upload completely sent off: 241 out of 241 bytes < HTTP/1.1 200 OK < Content-Type: application/json;charset=UTF-8 < Cache-Control: no-store < Content-Length: 38 < Server: Jetty(8.1.3.v20120522) < * Connection #0 to host x.x.57.97 left intact {"jsonrpc":"2.0","id":1,"result":true}
Refresh token
curl -k -v -d '{"id":1,"method":"oauth2.createAccessToken","params":{"service_key":"m9f5kyzfjjrssz6d5sfkbuw3","client":{"client_id":"yq7chp6ufkeea587gp6wqa6x","client_secret":"Azn4Xa"},"token_data":{"grant_type":"refresh_token","refresh_token":"xekntywdyp2hg7yvfbaxac5g"},"uri":{"redirect_uri":"https://some.com/cb"},"user_context":null},"jsonrpc":"2.0"}' 'https://x.x.57.97:8083/v3/json-rpc' -u root:changeme -k * Trying x.x.57.97... * Connected to x.x.57.97 (x.x.57.97) port 8083 (#0) * found 148 certificates in /etc/ssl/certs/ca-certificates.crt * found 592 certificates in /etc/ssl/certs * ALPN, offering http/1.1 * SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256 * server certificate verification SKIPPED * server certificate status verification SKIPPED * common name: api.example.com (does not match 'x.x.57.97') * server certificate expiration date OK * server certificate activation date OK * certificate public key: RSA * certificate version: #3 * subject: C=defC,ST=defST,L=defL,O=defO,OU=defOU,CN=api.example.com * start date: Wed, 14 Nov 2018 03:28:23 GMT * expire date: Fri, 21 Oct 2118 03:28:23 GMT * issuer: C=defC,ST=defST,L=defL,O=defO,OU=defOU,CN=api.example.com * compression: NULL * ALPN, server did not agree to a protocol * Server auth using Basic with user 'root' > POST /v3/json-rpc HTTP/1.1 > Host: x.x.57.97:8083 > Authorization: Basic cm9vdDpjaGFuZ2VtZQ== > User-Agent: curl/7.47.0 > Accept: */* > Content-Length: 339 > Content-Type: application/x-www-form-urlencoded > * upload completely sent off: 339 out of 339 bytes < HTTP/1.1 200 OK < Content-Type: application/json;charset=UTF-8 < Cache-Control: no-store < Content-Length: 274 < Server: Jetty(8.1.3.v20120522) < * Connection #0 to host x.x.57.97 left intact {"jsonrpc":"2.0","id":1,"result":{"token_type":"bearer","return_type":"json","access_token":"z242k8wyshjmvjrkcckask2f","expires_in":36000,"refresh_token":"epecdr7zzfjxwwfu35395dx9","scope":null,"user_context":"testUser1455730448397","uri":null,"extended":null,"state":null}}
Sample Calls through Proxy Endpoint
Note: This section uses the settings from the
Proxy Endpoint Creation in Tethered section in
OAuth Authenticator Service Configuration.
Create access token
curl -v -d '{"id":1,"method":"oauth2.createAccessToken","params":{"service_key":"m9f5kyzfjjrssz6d5sfkbuw3","client":{"client_id":"yq7chp6ufkeea587gp6wqa6x","client_secret":"Azn4Xa"},"token_data":{"grant_type":"implicit"},"uri":{"redirect_uri":"https://some.com/cb"},"user_context":"testUser1455730448397"},"jsonrpc":"2.0"}' -H 'Host: chainsproxy.api.mashery.com' -H 'Content-Type: application/json' 'http://192.168.99.100:80/v2/oauth/?api_key=8qavf83pg2uzgndtxz2w4dg3' * Trying 192.168.99.100... * Connected to 192.168.99.100 (192.168.99.100) port 80 (#0) > POST /oauth/auth/v2/?api_key=8qavf83pg2uzgndtxz2w4dg3 HTTP/1.1 > Host: chainsproxy.api.mashery.com > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Content-Length: 310 > * upload completely sent off: 310 out of 310 bytes < HTTP/1.1 200 OK < X-Mashery-Responder: 8abfe284898c < Content-Type: application/json;charset=UTF-8 < Cache-Control: no-store < Content-Length: 231 < Date: Tue, 30 Oct 2018 00:38:26 GMT < * Connection #0 to host 192.168.99.100 left intact {"jsonrpc":"2.0","id":1,"result":{"token_type":"bearer","return_type":"json","access_token":"unrct8wsweny8h3b3kw39wab","expires_in":36000,"scope":null,"user_context":"testUser1455730448397","uri":null,"extended":null,"state":null}}
Create authorization code
curl -v -d '{ "id":1,"method":"oauth2.createAuthorizationCode","params":{"service_key":"m9f5kyzfjjrssz6d5sfkbuw3","client":{"client_id":"yq7chp6ufkeea587gp6wqa6x"},"response_type":"code","uri":{"redirect_uri":"https://some.com/cb"},"user_context": "testUser1455730448397"},"jsonrpc":"2.0"}' -H 'Host: chainsproxy.api.mashery.com' -H 'Content-Type: application/json' 'http://192.168.99.100:80/v2/oauth/?api_key=8qavf83pg2uzgndtxz2w4dg3' * Trying 192.168.99.100... * Connected to 192.168.99.100 (192.168.99.100) port 80 (#0) > POST /oauth/auth/v2/?api_key=8qavf83pg2uzgndtxz2w4dg3 HTTP/1.1 > Host: chainsproxy.api.mashery.com > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Content-Length: 277 > * upload completely sent off: 277 out of 277 bytes < HTTP/1.1 200 OK < X-Mashery-Responder: 8abfe284898c < Content-Type: application/json;charset=UTF-8 < Cache-Control: no-store < Content-Length: 168 < Date: Tue, 30 Oct 2018 00:42:12 GMT < * Connection #0 to host 192.168.99.100 left intact {"jsonrpc":"2.0","id":1,"result":{"code":"p2kjsmn8mw2xb3d2ksryxk6z","uri":{"redirect_uri":"https://some.com/cb?code=p2kjsmn8mw2xb3d2ksryxk6z","state":""}},"error":null}
Create access token with authorization code
curl -v -d '{ "id":1,"method":"oauth2.createAuthorizationCode","params":{"service_key":"m9f5kyzfjjrssz6d5sfkbuw3","client":{"client_id":"yq7chp6ufkeea587gp6wqa6x"},"response_type":"code","uri":{"redirect_uri":"https://some.com/cb"},"user_context": "testUser1455730448397"},"jsonrpc":"2.0"}' -H 'Host: chainsproxy.api.mashery.com' -H 'Content-Type: application/json' 'http://192.168.99.100:80/v2/oauth/?api_key=8qavf83pg2uzgndtxz2w4dg3' * Trying 192.168.99.100... * Connected to 192.168.99.100 (192.168.99.100) port 80 (#0) > POST /oauth/auth/v2/?api_key=8qavf83pg2uzgndtxz2w4dg3 HTTP/1.1 > Host: chainsproxy.api.mashery.com > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Content-Length: 277 > * upload completely sent off: 277 out of 277 bytes < HTTP/1.1 200 OK < X-Mashery-Responder: 8abfe284898c < Content-Type: application/json;charset=UTF-8 < Cache-Control: no-store < Content-Length: 168 < Date: Tue, 30 Oct 2018 00:42:12 GMT < * Connection #0 to host 192.168.99.100 left intact {"jsonrpc":"2.0","id":1,"result":{"code":"p2kjsmn8mw2xb3d2ksryxk6z","uri":{"redirect_uri":"https://some.com/cb?code=p2kjsmn8mw2xb3d2ksryxk6z","state":""}},"error":null}
Update access token
curl -v -d '{"id":1,"method":"oauth2.updateAccessToken","params":{"service_key":"m9f5kyzfjjrssz6d5sfkbuw3","client":{"client_id":"yq7chp6ufkeea587gp6wqa6x","client_secret":"Azn4Xa"}, "access_token":"rjzb2k26cgv7tufe2j8cs7rm","user_context":"testUser1455730448397", "expires_in":600},"jsonrpc":"2.0"}' -H 'Host: chainsproxy.api.mashery.com' -H 'Content-Type: application/json' 'http://192.168.99.100:80/v2/oauth/?api_key=8qavf83pg2uzgndtxz2w4dg3' * Trying 192.168.99.100... * Connected to 192.168.99.100 (192.168.99.100) port 80 (#0) > POST /oauth/auth/v2/?api_key=8qavf83pg2uzgndtxz2w4dg3 HTTP/1.1 > Host: chainsproxy.api.mashery.com > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Content-Length: 287 > * upload completely sent off: 287 out of 287 bytes < HTTP/1.1 200 OK < X-Mashery-Responder: 8abfe284898c < Content-Type: application/json;charset=UTF-8 < Cache-Control: no-store < Content-Length: 322 < Date: Tue, 30 Oct 2018 01:01:50 GMT < * Connection #0 to host 192.168.99.100 left intact {"jsonrpc":"2.0","id":1,"result":{"token_type":"bearer","access_token":"rjzb2k26cgv7tufe2j8cs7rm","expires":"2018-10-30T11:01:50Z","refresh_token_expires":1540864158505,"scope":null,"user_context":"testUser1455730448397","uri":null,"grant_type":"authorization_code","client_id":"yq7chp6ufkeea587gp6wqa6x","extended":null}
Fetch access token
curl -v -d '{"id": 1,"jsonrpc":"2.0","method": "oauth2.fetchAccessToken","params": {"service_key":"m9f5kyzfjjrssz6d5sfkbuw3","access_token": "rjzb2k26cgv7tufe2j8cs7rm"}}' -H 'Host: chainsproxy.api.mashery.com' -H 'Content-Type: application/json' 'http://192.168.99.100:80/v2/oauth/?api_key=8qavf83pg2uzgndtxz2w4dg3' * Trying 192.168.99.100... * Connected to 192.168.99.100 (192.168.99.100) port 80 (#0) > POST /oauth/auth/v2/?api_key=8qavf83pg2uzgndtxz2w4dg3 HTTP/1.1 > Host: chainsproxy.api.mashery.com > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Content-Length: 157 > * upload completely sent off: 157 out of 157 bytes < HTTP/1.1 200 OK < X-Mashery-Responder: 8abfe284898c < Content-Type: application/json;charset=UTF-8 < Cache-Control: no-store < Content-Length: 242 < Date: Tue, 30 Oct 2018 01:05:25 GMT < * Connection #0 to host 192.168.99.100 left intact {"jsonrpc":"2.0","id":1,"result":{"token_type":"bearer","expires":"2018-10-30T11:01:50Z","scope":null,"user_context":"testUser1455730448397","uri":null,"grant_type":"authorization_code","client_id":"yq7chp6ufkeea587gp6wqa6x","extended":null}}
Fetch application
curl -v -d '{"id": 1,"jsonrpc":"2.0","method":"oauth2.fetchApplication","params":{"service_key":"m9f5kyzfjjrssz6d5sfkbuw3","client":{"client_id":"yq7chp6ufkeea587gp6wqa6x","client_secret":"Azn4Xa"}}}' -H 'Host: chainsproxy.api.mashery.com' -H 'Content-Type: application/json' 'http://192.168.99.100:80/v2/oauth/?api_key=8qavf83pg2uzgndtxz2w4dg3' * Trying 192.168.99.100... * Connected to 192.168.99.100 (192.168.99.100) port 80 (#0) > POST /oauth/auth/v2/?api_key=8qavf83pg2uzgndtxz2w4dg3 HTTP/1.1 > Host: chainsproxy.api.mashery.com > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Content-Length: 187 > * upload completely sent off: 187 out of 187 bytes < HTTP/1.1 200 OK < X-Mashery-Responder: 8abfe284898c < Content-Type: application/json;charset=UTF-8 < Cache-Control: no-store < Content-Length: 82 < Date: Tue, 30 Oct 2018 01:10:58 GMT < * Connection #0 to host 192.168.99.100 left intact {"jsonrpc":"2.0","id":1,"result":{"id":251547,"name":"TestOAuthRegisterCallBack"}}
Fetch user application
curl -v -d '{ "id":1, "method":"oauth2.fetchUserApplications", "params":{ "service_key":"m9f5kyzfjjrssz6d5sfkbuw3", "user_context":"testUser1455730448397" },"jsonrpc":"2.0"}' -H 'Host: chainsproxy.api.mashery.com' -H 'Content-Type: application/json' 'http://192.168.99.100:80/v2/oauth/?api_key=8qavf83pg2uzgndtxz2w4dg3' * Trying 192.168.99.100... * Connected to 192.168.99.100 (192.168.99.100) port 80 (#0) > POST /oauth/auth/v2/?api_key=8qavf83pg2uzgndtxz2w4dg3 HTTP/1.1 > Host: chainsproxy.api.mashery.com > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Content-Length: 162 > * upload completely sent off: 162 out of 162 bytes < HTTP/1.1 200 OK < X-Mashery-Responder: 8abfe284898c < Content-Type: application/json;charset=UTF-8 < Cache-Control: no-store < Content-Length: 195 < Date: Tue, 30 Oct 2018 01:12:32 GMT < * Connection #0 to host 192.168.99.100 left intact {"jsonrpc":"2.0","id":1,"result":[{"id":251547,"name":"TestOAuthRegisterCallBack","access_tokens":["rjzb2k26cgv7tufe2j8cs7rm","unrct8wsweny8h3b3kw39wab"],"client_id":"yq7chp6ufkeea587gp6wqa6x"}]}
Revoke access token
curl -v -d '{ "id":1, "method":"oauth2.revokeAccessToken", "params":{ "service_key":"m9f5kyzfjjrssz6d5sfkbuw3", "client": { "client_id":"yq7chp6ufkeea587gp6wqa6x", "client_secret":"Azn4Xa" }, "access_token":"rjzb2k26cgv7tufe2j8cs7rm" },"jsonrpc":"2.0"}' -H 'Host: chainsproxy.api.mashery.com' -H 'Content-Type: application/json' 'http://192.168.99.100:80/v2/oauth/?api_key=8qavf83pg2uzgndtxz2w4dg3' * Trying 192.168.99.100... * Connected to 192.168.99.100 (192.168.99.100) port 80 (#0) > POST /oauth/auth/v2/?api_key=8qavf83pg2uzgndtxz2w4dg3 HTTP/1.1 > Host: chainsproxy.api.mashery.com > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Content-Length: 240 > * upload completely sent off: 240 out of 240 bytes < HTTP/1.1 200 OK < X-Mashery-Responder: 8abfe284898c < Content-Type: application/json;charset=UTF-8 < Cache-Control: no-store < Content-Length: 38 < Date: Tue, 30 Oct 2018 01:17:10 GMT < * Connection #0 to host 192.168.99.100 left intact {"jsonrpc":"2.0","id":1,"result":true}
Revoke user application
Refresh token
curl -v -d '{ "id":1, "method":"oauth2.revokeUserApplication", "params":{ "service_key":"m9f5kyzfjjrssz6d5sfkbuw3", "client": { "client_id":"yq7chp6ufkeea587gp6wqa6x", "client_secret":"Azn4Xa" }, "user_context":"testUser1455730448397" },"jsonrpc":"2.0"}' -H 'Host: chainsproxy.api.mashery.com' -H 'Content-Type: application/json' 'http://192.168.99.100:80/v2/oauth/?api_key=8qavf83pg2uzgndtxz2w4dg3' * Trying 192.168.99.100... * Connected to 192.168.99.100 (192.168.99.100) port 80 (#0) > POST /oauth/auth/v2/?api_key=8qavf83pg2uzgndtxz2w4dg3 HTTP/1.1 > Host: chainsproxy.api.mashery.com > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Content-Length: 241 > * upload completely sent off: 241 out of 241 bytes < HTTP/1.1 500 Server Error < X-Mashery-Responder: 8abfe284898c < Content-Type: application/json;charset=UTF-8 < Cache-Control: no-store < Content-Length: 81 < Date: Tue, 30 Oct 2018 16:41:56 GMT < * Connection #0 to host 192.168.99.100 left intact {"jsonrpc":"2.0","id":1,"error":{"message":"Internal Server Error","code":-2001}}
curl -k -v -d '{"id":1,"method":"oauth2.createAccessToken","params":{"service_key":"m9f5kyzfjjrssz6d5sfkbuw3","client":{"client_id":"yq7chp6ufkeea587gp6wqa6x","client_secret":"Azn4Xa"},"token_data":{"grant_type":"refresh_token","refresh_token":"8f9qy6jrw3r23j2r6wqwp2jh"},"uri":{"redirect_uri":"https://some.com/cb"},"user_context":null},"jsonrpc":"2.0"}' -H 'Host: chainsproxy.api.mashery.com' -H 'Content-Type: application/json' 'http://192.168.99.100:80/v2/oauth/?api_key=8qavf83pg2uzgndtxz2w4dg3' * Trying 192.168.99.100... * Connected to 192.168.99.100 (192.168.99.100) port 80 (#0) > POST /oauth/auth/v2/?api_key=8qavf83pg2uzgndtxz2w4dg3 HTTP/1.1 > Host: chainsproxy.api.mashery.com > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Content-Length: 339 > * upload completely sent off: 339 out of 339 bytes < HTTP/1.1 200 OK < X-Mashery-Responder: 8abfe284898c < Content-Type: application/json;charset=UTF-8 < Cache-Control: no-store < Content-Length: 274 < Date: Tue, 30 Oct 2018 16:55:36 GMT < * Connection #0 to host 192.168.99.100 left intact {"jsonrpc":"2.0","id":1,"result":{"token_type":"bearer","return_type":"json","access_token":"79rkkkxd4rk2zzbrqj4z93vb","expires_in":36000,"refresh_token":"7db67za3xvdg99nc7gnctkqw","scope":null,"user_context":"testUser1455730448397","uri":null,"extended":null,"state":null}}
Copyright © 2022. Cloud Software Group, Inc. All Rights Reserved.