Authenticate User

Authentication of the user is the first API call you'll need to call when you are about to register a new transaction for a user that have not made any transaction with NexaStake so far.

We suggest to store the user's uuid once you create it so that for the next transaction initiated by the same user you don't need to make that API call.

Bare in mind that uuid is really essential especially if you enable the following option for the brand:

We will provide the user uuid in the callback for any transaction that was Blockchain-initialized aka followup transfers on the transaction/blockchain address.

So in order to make an API call to authenticate the user, do the following:

Send POST request to: URL: https://www.nexastake.com/api/authenticate Authorization: Bearer nexastake_API_KEY Content-Type: application/x-www-form-urlencoded Post Fields: - name: Peter Ter - email: [email protected] And here are several code examples:

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://www.nexastake.com/api/authenticate',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'name=Peter%20Ter&email=peter.ter%40beer.com',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/x-www-form-urlencoded',
    'Authorization: Bearer nexastake_API_KEY'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Regardless of the programming language all will receive the same response:

{
    "uuid": "d9dd9761-835e-485e-b955-fd8280e53049",
    "name": "Peter Ter",
    "email": "[email protected]"
}

Last updated