Session Token
Access Token lets you transact and fetch details from a particular user account. To generate an Access token, you must pass the API Key, Request Token, and API secret. to create an Access token.
Endpoint
https://connects.torusdigital.com/api/v1/session/generateHeader Parameters
Name
Value
Content-Type
application/json
Token
<Token>
Request Parameters
ATTRIBUTE
DESCRIPTION
API_SECRET
The apiSecret generated during Merchant Onboarding step for the specific merchant
API_KEY
The apiKey generated during Merchant Onboarding step for the specific merchant
Request
curl --location 'https://connects.torusdigital.com/api/v1/session/generate' \
--header 'Token: {{token}}' \
--header 'Content-Type: application/json' \
--data '{
"API_KEY": "<API_KEY>",
"API_SECRET": "<API_SECRET>"
}'Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://connects.torusdigital.com/api/v1/session/generate")
.header("Token", "{{token}}")
.header("Content-Type", "application/json")
.body("{\n" +
" \"API_KEY\": \"<API_KEY>\",\n" +
" \"API_SECRET\": \"<API_SECRET>\"\n" +
"}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://connects.torusdigital.com/api/v1/session/generate"
method := "POST"
payload := strings.NewReader(`{
"API_KEY": "<API_KEY>",
"API_SECRET": "<API_SECRET>"
}`)
client := &http.Client{}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Token", "{{token}}")
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}var settings = {
"url": "https://connects.torusdigital.com/api/v1/session/generate",
"method": "POST",
"timeout": 0,
"headers": {
"Token": "{{token}}",
"Content-Type": "application/json"
},
"data": JSON.stringify({
"API_KEY": "<API_KEY>",
"API_SECRET": "<API_SECRET>"
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});Response
{
"AccessToken": "<AccessToken>",
}Last updated