Disconnect

Disconnect database

Method

DELETE

URI

/api/database/connection

Headers

Content-Type	application/json
Authorization   Bearer <long-access-token>

Result

{}

Examples

const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "Bearer <long-access-token>");

const apiURL = 'https://api-test-tool.backend.spacemonopoly3d.com/'
const requestOptions = {
  method: 'DELETE',
  headers: myHeaders,
  redirect: 'follow'
};

fetch(apiURL + "api/database/connection", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
const request = require('request');
const apiURL = 'https://api-test-tool.backend.spacemonopoly3d.com/'
const options = {
  'method': 'DELETE',
  'url': apiURL + 'api/database/connection',
  'headers': {
    'Content-Type': ['application/json'],
    'Authorization': 'Bearer <long-access-token>'
  }
};
request(options, function (error, response) { 
  if (error) throw new Error(error);
  console.log(response.body);
});
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api-test-tool.backend.spacemonopoly3d.com/api/database/connection');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$longAccessToken = 'long_access_token';
$request->setHeader(array(
  'Content-Type' => 'application/json',
  'Authorization' => "Bearer {$longAccessToken}"
));

try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}