{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"8cdab229-9533-4a06-8f85-d641be0a06f3","name":"Bitbns API","description":"# Introduction\nAPI Docs for the Bitbns Cryptocurrency Exchange.  \nOfficial NPM Package: https://github.com/bitbns-official/node-bitbns-api\n\n# Overview\nThings that the developers should know about\n- Body is always a JSON stringified object as shown\n\n# Authentication\nThe authentication is done using API KEY and API SECRET supplied to the user. The body to be sent is a stringified JSON object and the same is used to generate the signature to be supplied with the request. Signature generation can be checked using the \"Pre Request Script\" tab in Postman(\"Open with Postman\" Button at top right of the page).\n\n### Sample Code for Node.js\n```js\nconst CryptoJS = require(\"crypto-js\");\n\nlet timeStamp_nonce = Date.now().toString();\nlet bodystring = `{\"symbol\":\"BTC\",\"entry_id\":\"2814697\"}`\nconst body = JSON.parse(bodystring)\nconst secret = \"asdfghjkl\"\nconst obj = {\n    timeStamp_nonce: timeStamp_nonce,\n    body: JSON.stringify(body)\n};\nconst payload = new Buffer(JSON.stringify(obj)).toString('base64');\nconst signature = CryptoJS.enc.Hex.stringify(CryptoJS.HmacSHA512(payload, secret));\nconsole.log(\"Payload:\", payload)\nconsole.log(\"\\nSignature:\",signature)\n\n```\n\n### Sample Code for Python\n```python3\nfrom datetime import datetime\nimport hmac\nimport hashlib\nimport base64\nimport json\ntimeStamp_nonce = str(round(datetime.now().timestamp()*1000))\nprint(timeStamp_nonce)\nbodystring = \"{\\\"symbol\\\":\\\"BTC\\\",\\\"entry_id\\\":\\\"2814697\\\"}\"\nsecret = \"asdfghjkl\"\nobj = {\n    \"timeStamp_nonce\": timeStamp_nonce,\n    \"body\": bodystring\n};\npayload = base64.b64encode(json.dumps(obj).replace(\" \",\"\").encode())\nm = hmac.new(secret.encode('utf-8'), payload, hashlib.sha512)\nsignature = m.hexdigest()\nprint(\"Payload:\",payload.decode())\nprint(\"Signature:\", signature)\n```\n\n### Sample Code for Golang\n```go\npackage main\n\nimport \"fmt\"\nimport \"time\"\nimport \"strconv\"\nimport \"encoding/json\"\nimport \"encoding/base64\"\nimport (\n    \"crypto/hmac\"\n    \"crypto/sha512\"\n    \"encoding/hex\"\n)\n\nfunc main() {\n  now := time.Now()\n  milli := now.Unix()*1000\n  timeStamp_nonce := strconv.FormatInt(milli, 10)\n  // timeStamp_nonce = \"1590705014350\"\n  bodystring := \"{\\\"symbol\\\":\\\"BTC\\\",\\\"entry_id\\\":\\\"2814697\\\"}\"\n  secret := \"asdfghjkl\"\n  obj := map[string]string{\n    \"body\": bodystring,\n    \"timeStamp_nonce\": timeStamp_nonce,\n  };\n  data, _ := json.Marshal(obj)\n  payload := base64.StdEncoding.EncodeToString([]byte(data))\n  fmt.Println(\"Payload:\",payload)\n  h := hmac.New(sha512.New, []byte(secret))\n  h.Write([]byte(data))\n  signature := hex.EncodeToString(h.Sum(nil))\n  fmt.Println(\"\\nSignature:\",signature)\n}\n```\n\n### Sample Code for PHP\n```php\n<?php\n$t=round(microtime(true) * 1000);\n$timeStamp_nonce = strval($t);\n$timeStamp_nonce = \"1590705014350\";\n// echo($timeStamp_nonce);\n$bodystring = \"{\\\"symbol\\\":\\\"BTC\\\",\\\"entry_id\\\":\\\"2814697\\\"}\";\n$secret = \"asdfghjkl\";\n$obj->timeStamp_nonce = $timeStamp_nonce;\n$obj->body = $bodystring;\n$myJSON = json_encode($obj);\n$payload = base64_encode($myJSON);\necho(\"Payload:\" . $payload);\n$sig = hash_hmac('sha512', $payload, $secret);\necho(\"\\n\\nSignature:\" . $sig);\n```\n\n# Error Codes\n> HTTP error codes would be returned in case of any errors, the body will also contain an error field  which will explain the cause of the error\n\n<div id =\"HTTP_error_code_table\" style =\"border:1px solid\">\n  <table style = \"width:100%\">\n    <tr>\n      <th>Code</th>\n      <th>Meaning</th>\n    </tr>\n    <tr>\n      <th></th>\n      <th></th>\n    </tr>\n    <tr>\n      <th>200</th>\n      <th>null -- requested action has been performed without any problems </th>\n    </tr>\n    <tr>\n      <th>400</th>\n      <th>Invalid Request -- Invalid request format</th>\n    </tr>\n    <tr>\n      <th>401</th>\n      <th>authentication -- Not authorised or invalid API key</th>\n    </tr>\n    <tr>\n      <th>403</th>\n      <th>Undefined -- this request is forbidden</th>\n    </tr>\n    <tr>\n      <th>404</th>\n      <th>Exchange not found -- Unable to find exchange</th>\n    </tr>\n    <tr>\n      <th>406</th>\n      <th>Coin name not supplied or not yet supported -- coin name applied is incorrect</th>\n    </tr>\n    <tr>\n      <th>409</th>\n      <th>parameter type not correct -- parameters entered is incorrect</th>\n    </tr>\n    <tr>\n      <th>412</th>\n      <th>Oops ! Cancellation failed. Something went wrong ! -- Unable to cancel order</th>\n    </tr>\n    <tr>\n      <th>413</th>\n      <th>volume asked not acceptable -- Desired volume is not within bounds</th>\n    </tr>\n     <tr>\n      <th>416</th>\n      <th>Oops ! Not sufficient balance to purchase currency -- wallet balance is not sufficient </th>\n    </tr>\n     <tr>\n      <th>417</th>\n      <th>Oops ! Order doesn't exist any more -- Order has alredy been deleted</th>\n    </tr>\n     <tr>\n      <th>428</th>\n      <th>Price seems Irregular from current market price. -- Entered price is more than current price</th>\n    </tr>\n         <tr>\n      <th>500</th>\n      <th>Problem with our servers, try again later</th>\n    </tr>\n         <tr>\n      <th>503</th>\n      <th>currently down for maintaince</th>\n    </tr>\n    </tr>\n  </table>\n</div>\n\n# Rate limit\nThere are two individual rate limits for read and write type requests.  \nThese are returned in the response headers of the API.","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"2372406","team":329595,"collectionId":"8cdab229-9533-4a06-8f85-d641be0a06f3","publishedId":"Szt5hBp7","public":true,"publicUrl":"https://documenter-api.postman.tech/view/2372406/Szt5hBp7","privateUrl":"https://go.postman.co/documentation/2372406-8cdab229-9533-4a06-8f85-d641be0a06f3","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"documentationLayout":"classic-double-column","customisation":null,"version":"8.10.1","publishDate":"2020-05-20T23:57:12.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/9a557dd548d9aaac0fc0b97aecf1e8194be891bc4c9736af5cf45ad2b1c7a2e9","favicon":""},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"}],"canonicalUrl":"https://documenter.gw.postman.com/view/metadata/Szt5hBp7"}