Skip to main content
GET
/
v1
/
mock-apis
/
{mockApiId}
Get mock API by ID
curl --request GET \
  --url https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId} \
  --header 'Authorization: <api-key>'
import requests

url = "https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}"

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/mock-apis/{mockApiId}', 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/mock-apis/{mockApiId}",
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/mock-apis/{mockApiId}"

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/mock-apis/{mockApiId}")
.header("Authorization", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}")

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
{
  "mockApi": {
    "id": "jjl8y",
    "aclObject": "gkqjy",
    "name": "My new mock API",
    "description": "This is a sample mock API for testing purposes.",
    "state": "RUNNING",
    "adminSecurityEnabled": true,
    "exportState": "EXPORT_ALLOWED",
    "createdDate": "2024-08-23T21:34:36.595372Z",
    "openApiGitIntegration": "jjl8y-openapi-integration-git",
    "links": {
      "self": "/v1/mock-apis/jjl8y",
      "requests": "/v1/mock-apis/jjl8y/requests",
      "mappings": "/v1/mock-apis/jjl8y/mappings",
      "scenarios": "/v1/mock-apis/jjl8y/scenarios",
      "recordings": {
        "start": "/v1/mock-apis/jjl8y/recordings/start",
        "stop": "/v1/mock-apis/jjl8y/recordings/stop",
        "status": "/v1/mock-apis/jjl8y/recordings/status",
        "snapshot": "/v1/mock-apis/jjl8y/recordings/snapshot"
      },
      "imports": "/v1/mock-apis/jjl8y/imports",
      "organisation": "/v1/organisations/mgk7g",
      "apiTemplate": "/v1/api-templates/8nd5x",
      "aclObject": "/v1/acl/objects/gkqjy",
      "aclRoles": "/v1/acl/objects/gkqjy/roles",
      "invitations": "/v1/mock-apis/jjl8y/invitations",
      "acl": "/v1/mock-apis/jjl8y/acl{?subjectId}",
      "versionHistoryCommits": "/v1/mock-apis/jjl8y/version-history/commits"
    },
    "baseUrl": "https://jjl8y.wiremockapi.cloud",
    "domainNames": [
      {
        "domainName": "my-new-mock-api.wiremockapi.cloud",
        "editableSubdomainPart": "my-new-mock-api",
        "urls": [
          {
            "url": "https://my-new-mock-api.wiremockapi.cloud"
          },
          {
            "url": "http://my-new-mock-api.wiremockapi.cloud"
          }
        ]
      },
      {
        "domainName": "jjl8y.wiremockapi.cloud",
        "urls": [
          {
            "url": "https://jjl8y.wiremockapi.cloud"
          },
          {
            "url": "http://jjl8y.wiremockapi.cloud"
          }
        ]
      }
    ],
    "domains": [
      "jjl8y.wiremockapi.cloud",
      "my-new-mock-api.wiremockapi.cloud"
    ]
  },
  "openApiGitIntegrations": [
    {
      "test": "/v1/mock-apis/jjl8y/open-api-integrations/git/test",
      "mockApi": "jjl8y",
      "enabled": false,
      "id": "jjl8y-openapi-integration-git",
      "links": {
        "self": "/v1/mock-apis/jjl8y/open-api-integrations/git"
      }
    }
  ]
}
{
"errors": [
{
"title": "Forbidden",
"source": {}
}
]
}

Authorizations

Authorization
string
header
required

Your API key prefixed by 'Token '

Path Parameters

mockApiId
string
required

The ID of the Mock API

Required string length: 5 - 10
Example:

"jjl8y"

Response

200 response

mockApi
object
required