Get database connections accessible by a user
curl --request GET \
--url https://wmc.wiremockapi.cloud/v1/users/{userId}/database-connections \
--header 'Authorization: <api-key>'import requests
url = "https://wmc.wiremockapi.cloud/v1/users/{userId}/database-connections"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://wmc.wiremockapi.cloud/v1/users/{userId}/database-connections', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://wmc.wiremockapi.cloud/v1/users/{userId}/database-connections",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://wmc.wiremockapi.cloud/v1/users/{userId}/database-connections"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://wmc.wiremockapi.cloud/v1/users/{userId}/database-connections")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://wmc.wiremockapi.cloud/v1/users/{userId}/database-connections")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"databaseConnections": [
{
"id": "abc123",
"connectionName": "My database connection",
"databaseType": "POSTGRESQL",
"host": "my-db.example.com",
"port": 5432,
"databaseName": "my-test-data",
"username": "alice",
"links": {
"self": "/v1/data-connections/abc123"
}
},
{
"id": "def456",
"connectionName": "My other database connection",
"databaseType": "MYSQL",
"host": "my.sql.com",
"port": 3306,
"databaseName": "my-sql-data",
"username": "bob",
"links": {
"self": "/v1/data-connections/def456"
}
}
],
"links": {
"self": "/v1/users/my-user/database-connections?page=2&limit=20",
"next": "/v1/users/my-user/database-connections?page=3&limit=20",
"previous": "/v1/users/my-user/database-connections?page=1&limit=20"
},
"meta": {
"start": 21,
"end": 40,
"total": 123,
"page": 2,
"totalPages": 7
}
}{
"errors": [
{
"title": "Invalid query parameter format",
"detail": "The offset parameter value must be a positive integer"
}
]
}"Credentials are required to access this resource."{
"errors": [
{
"title": "Forbidden",
"source": {}
}
]
}Database connections
Get database connections accessible by a user
GET
/
v1
/
users
/
{userId}
/
database-connections
Get database connections accessible by a user
curl --request GET \
--url https://wmc.wiremockapi.cloud/v1/users/{userId}/database-connections \
--header 'Authorization: <api-key>'import requests
url = "https://wmc.wiremockapi.cloud/v1/users/{userId}/database-connections"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://wmc.wiremockapi.cloud/v1/users/{userId}/database-connections', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://wmc.wiremockapi.cloud/v1/users/{userId}/database-connections",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://wmc.wiremockapi.cloud/v1/users/{userId}/database-connections"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://wmc.wiremockapi.cloud/v1/users/{userId}/database-connections")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://wmc.wiremockapi.cloud/v1/users/{userId}/database-connections")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"databaseConnections": [
{
"id": "abc123",
"connectionName": "My database connection",
"databaseType": "POSTGRESQL",
"host": "my-db.example.com",
"port": 5432,
"databaseName": "my-test-data",
"username": "alice",
"links": {
"self": "/v1/data-connections/abc123"
}
},
{
"id": "def456",
"connectionName": "My other database connection",
"databaseType": "MYSQL",
"host": "my.sql.com",
"port": 3306,
"databaseName": "my-sql-data",
"username": "bob",
"links": {
"self": "/v1/data-connections/def456"
}
}
],
"links": {
"self": "/v1/users/my-user/database-connections?page=2&limit=20",
"next": "/v1/users/my-user/database-connections?page=3&limit=20",
"previous": "/v1/users/my-user/database-connections?page=1&limit=20"
},
"meta": {
"start": 21,
"end": 40,
"total": 123,
"page": 2,
"totalPages": 7
}
}{
"errors": [
{
"title": "Invalid query parameter format",
"detail": "The offset parameter value must be a positive integer"
}
]
}"Credentials are required to access this resource."{
"errors": [
{
"title": "Forbidden",
"source": {}
}
]
}Path Parameters
Query Parameters
The amount of page items to retrieve.
The index of the page to retrieve.
A filter for the retrieved items. Only items whose name contains the filter value will be retrieved. The filter is case insensitive.
⌘I