Change or Update API Keys

Requesting or updating your api key takes two turns of request, the first step is to Initiate the API key change this step send an authorization token to the email and phone number associated with your account, and the second step receives the token and upon successful validation updates your API keys.

Steps

  1. Authorization of API KEYS change via OTP
  2. Supply OTP and receive changed keys

Authorization of API KEYS change via OTP

To request a new live_public_key and live_secret_key you need to authorize the request first via OTP, an example of this request is show below

Example

var axios = require('axios');

var config = {
  method: 'post',
  url: 'https://integrations.getravenbank.com/v1/accounts/change_keys',
  headers: { }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
{
  "status": "success",
  "message": "otp sent to email successfully",
  "data": true
}

Supply OTP and receive changed keys

At this stage we assume you already have the OTP sent to you and so to proceed we need to parse the OTP in our request body as shown in the example below.

var axios = require('axios');
var qs = require('qs');
var data = qs.stringify({
  'code': '076290' 
});
var config = {
  method: 'post',
  url: 'https://integrations.getravenbank.com/v1/accounts/change_keys_with_otp',
  headers: { },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
{
  "status": "success",
  "message": "Your keys have been changed successfully",
  "data": {
    "live_public_key": "RVPUB-ebca699b7573b83f20fdb14038f2a6a8f060af060c8844d46034dfe3144e-1655334379324",
    "live_secret_key": "RVSEC-fe091e348f816a5a044acfa01da9cb1e41c7e565f0a5f2bc9a90060c8cc72e5f9ef42297b1ea3f0535daba3d040bf61d-1655334379324"
  }
}

👍

Try it in the console

Click here to try it