GetToken

API

PropertyValue

API

/v2/token

Title

GetToken

Description

Sign in Tako

Method

POST

Request Parameters

NameTypeRequiredDescription

message

string

YES

Format:

\nACCOUNT:\n{EVM-compatible Address}\nISSUED AT:\n{Time in RFC3339 format}\n\n

NOTE: The message structure above must be included, additional content can be added at the beginning and end of the message.

For example:

Tako wants you to sign in with your Ethereum account.\n\nThis request will not trigger a blockchain transaction or cost any gas fees.\n\nACCOUNT:\n0x4DD3DB5d0B9aAf0B0a2fBD37a489d2f0e3F234A9\n\nISSUED AT:\n2023-08-01T10:29:31.000Z\n

What looks like on the user’s wallet signing page, such as Metamask:

Tako wants you to sign in with your Ethereum account.

This request will not trigger a blockchain transaction or cost any gas fees.

ACCOUNT:

0x4DD3DB5d0B9aAf0B0a2fBD37a489d2f0e3F234A9

ISSUED AT:

2023-08-01T10:29:31.000Z

signature

string

YES

Elliptic curve signing of the message.

Parameter Content Type

application/json

Request and Response Example

Request

cURL Code

curl -X 'POST' \
  'https://api.tako.so/v2/token' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
    "message": "Tako wants you to sign in with your Ethereum account.\n\nThis request will not trigger a blockchain transaction or cost any gas fees.\n\nACCOUNT:\n0x4DD3DB5d0B9aAf0B0a2fBD37a489d2f0e3F234A9\n\nISSUED AT:\n2023-08-01T10:29:31.000Z\n\n",
    "signature": "0xa480712751eea94815608cd58a153b6380608d2b79439d9033eb936f9a23ef8445c59b3f60f76b0b411e67798e0a3c92750fda60fc15699cf5f247d3f3435ce31b"
  }'

Request URL

https://api.tako.so/v2/token

Response

NOTE: The token is the only credential to access APIs, so you must save it securely. Its validity period is 3600 seconds. You can use the refresh_token to refresh the token. Its validity period is 86400 seconds.

{
  "status": "success",
  "data": {
    "token_type": "Bearer",
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZGRyZXNzIjoiMHg0REQzREI1ZDBCOWFBZjBCMGEyZkJEMzdhNDg5ZDJmMGUzRjIzNEE5IiwidHlwZSI6InRva2VuIiwiZXhwIjoxNjkwOTYzNDQ3fQ.VeRSLf-8sEb6nsdieGBuJI8wktCyJPKzTLx-opCX7x4",
    "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZGRyZXNzIjoiMHg0REQzREI1ZDBCOWFBZjBCMGEyZkJEMzdhNDg5ZDJmMGUzRjIzNEE5IiwidHlwZSI6InJlZnJlc2hfdG9rZW4iLCJleHAiOjE2OTEwNDYyNDd9.ghFd7X-FHnYW16VWyi-75tzEh5L_r06vjAIo3kKcGKM",
    "expires_in": 3600
  }
}

Last updated