Get a temporary request token
Get a temporary request token (step 1 of the three-legged flow).
Sign with the consumer credentials only; sending an oauth_token is rejected. oauth_callback is required: an http(s) URL, or oob to have the verifier shown instead of redirected. In Postman, leave the token fields empty and fill in Callback URL under Advanced.
Response: application/x-www-form-urlencoded by default, or JSON when the request sends Accept: application/json. The request token expires after 10 minutes. Next: open GET /api/auth/oauth1/authorize?oauth_token=<request token>.Response: application/x-www-form-urlencoded by default, or JSON when the request sends Accept: application/json. The request token expires after 10 minutes. Next: open GET …<request token>.
OAuth 1.0a signature with the consumer credentials only: apibee-consumer-key / apibee-consumer-secret
Parameters 8
| Name | Type | Description |
|---|---|---|
oauth_consumer_keyrequired | header · string | apibee-consumer-key. In the Authorization: OAuth header, the query string or a form body (one place only). |
oauth_callbackrequired | header · string | An absolute http(s) URL to redirect to after authorization, or oob to get the verifier as JSON. |
oauth_signature_methodrequired | header · string | HMAC-SHA1, HMAC-SHA256, HMAC-SHA512 or PLAINTEXT. |
oauth_signaturerequired | header · string | Signed with the consumer secret only: the signing key is consumer_secret& (empty token secret). For PLAINTEXT, send apibee-consumer-secret%26. |
oauth_timestamp | header · string | Unix time in seconds, within 5 minutes of server time. Required for the HMAC methods; may be left out for PLAINTEXT. |
oauth_nonce | header · string | A random string; each one works once. Required for the HMAC methods; may be left out for PLAINTEXT. |
oauth_version | header · string | Optional. If sent, it must be 1.0. |
Accept | header · string | application/json for a JSON response. Without it the response is application/x-www-form-urlencoded. |
Responses
- 200
- oauth_token, oauth_token_secret, oauth_callback_confirmed=true and oauth_expires_in (600).
- 400
- parameter_absent (no oauth_callback), parameter_rejected (a bad callback, or an oauth_token was sent), or another protocol parameter problem.
- 401
- consumer_key_unknown, timestamp_refused, nonce_used or signature_invalid.
Example
curl -X POST "https://api.testingapis.com/api/auth/oauth1/request_token" \
-H "Accept: application/json" \
-H 'Authorization: OAuth oauth_consumer_key="apibee-consumer-key", oauth_signature_method="PLAINTEXT", oauth_callback="oob", oauth_signature="apibee-consumer-secret%26"' \
-H "X-TestingApis-Key: YOUR_API_KEY"{
"oauth_token": "o1rt_6112c483e357a56ceb9ea6d5fc7bc9e31e89b4ae",
"oauth_token_secret": "o1rs_e2e13614310bf304d0cec178961363cc9928cb74",
"oauth_callback_confirmed": "true",
"oauth_expires_in": "600"
}Sign in to see the details
The parameters, request and response examples and the live Try it panel for this endpoint are for signed-in members. Accounts are free and take a few seconds to create.