Gettoken not working, even by paytm client

what’s wrong here?

curl -i https://developer.paytmmoney.com/accounts/v2/gettoken -X POST -d '{"api_secret_key":"<mykey>","api_key":"<mykey>","request_token":"<mytoken>"}'  -H 'Content-Type: application/json' -H 'Accept: application/json'

response:

HTTP/2 400
content-type: application/json
content-length: 69
x-b3-traceid:
x-amzn-trace-id: Root=1-sometraceid
x-api-name: /accounts/v2/gettoken
x-start-time: 1675751407659
expires: Tue, 07 Feb 2023 06:30:07 GMT
cache-control: max-age=0, no-cache, no-store
pragma: no-cache
date: Tue, 07 Feb 2023 06:30:07 GMT

{"status":400,"message":"Bad Request","error_code":"PM_OPEN_API_400"}

why its a bad request?

Hi @codeofnode

If Api Key or Api Secret will be incorrect or Request token will be incorrect or expired. In that case you will get bad request.

Note: Validity of request token is 30 minutes.

1 Like

Request token is temporary token which can use only one time. So validity of request token is 30 min or 1 time use.

okay thanks. i thought request token is valid till 12 midnight. But that is access_token i read.

1 Like

request token is use to generate other token like access_token , read_access_token, public token. It is temporary token
More details
https://developer.paytmmoney.com/docs/api/generate-access-token/