Retrieving v2 OAS Files
- shell
- http
- js
- ruby
- java
- go
- response
# You can also use wget
curl -X GET https://TENANT_NAME.mambu.com/api/openapi/resources/{resource}/{version}/complete \
-u 'username:password'
GET https://TENANT_NAME.mambu.com/api/openapi/resources/{resource}/{version}/complete HTTP/1.1
Host: TENANT_NAME.mambu.com
Authorization: Basic <credentials>
var headers = {
'Authorization':'Basic <credentials>'
};
$.ajax({
url: 'https://TENANT_NAME.mambu.com/api/openapi/resources/{resource}/{version}/complete',
method: 'GET',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
require 'rest-client'
require 'json'
headers = {
'Authorization' => 'Basic <credentials>'
}
result = RestClient.get 'https://TENANT_NAME.mambu.com/api/openapi/resources/{resource}/{version}/complete',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Authorization': 'Basic <credentials>'
}
r = requests.get('https://TENANT_NAME.mambu.com/api/openapi/resources/{resource}/{version}/complete', params={
}, headers = headers)
print r.json()
URL obj = new URL("https://TENANT_NAME.mambu.com/api/openapi/resources/{resource}/{version}/complete");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestProperty("Authorization", "Basic <credentials>");
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Authorization": []string{"Basic <credentials>"}
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://TENANT_NAME.mambu.com/api/openapi/resources/{resource}/{version}/complete", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
Example response
{
"openapi" : "3.0.1",
"info" : {
"title" : "clients",
"version" : "v2"
},
"servers" : [ {
"url" : "http://localhost:8889/api"
}, {
"url" : "https://localhost:8889/api"
} ],
"security" : [ {
"basic" : [ ]
} ],
"tags" : [ {
"description" : "Allows you to get, create, update, or delete clients. Clients may have associated information such as their address, identification documents, or custom field values.",
"name" : "Clients"
} ]
}
Once you have followed the steps to retrieve the jsonPath value for a specific API, you can build the path to a specific resource.
To retrieve the specification file for a given API, join the base URL with the value of the relevant jsonPath.