The Jackal server provides five API routes which act as an interface to the service.
The Health Endpoint can be use to check the deployed Jackal service is alive.
METHOD: GET
URL: http://path.to.your.jackal.server:25863/api/health
STATUS: 200
BODY: 😊
METHOD: POST
HEADERS: Content-Type: application/json
URL: http://path.to.your.jackal.server:25863/api/contracts
BODY: <consumer_contracts_object>
The <consumer_contracts_object>
should be in the format specified in the Jackal Contract Guide.
The Consumer Endpoint supports multiple responses depending on whether the submitted Contracts were received, were valid, were executed with failures, were executed successfully & cached, or were failed to be cached.
STATUS: 400
HEADERS: Content-Type: application/json
BODY: {
message: 'One or more contracts are invalid',
status: 'INVALID',
results: []
}
STATUS: 400
HEADERS: Content-Type: application/json
BODY: {
message: 'Contract object must contain a single consumer',
status: 'INVALID',
results: []
}
STATUS: 400
HEADERS: Content-Type: application/json
BODY: {
message: 'One or more contracts are invalid',
status: 'INVALID',
results: <validations_array>
}
Details of the shape of the objects contained in the <validations_array>
can be found in the Jackal Validation Guide.
STATUS: 200
HEADERS: Content-Type: application/json
BODY: {
message: 'Failures Exist',
status: 'FAILED',
results: <results_array>
}
Details of the shape of the objects contained in the <results_array>
can be found in the Jackal Result Guide.
STATUS: 201
HEADERS: Content-Type: application/json
BODY: {
message: 'All Passed',
status: 'PASSED',
results: <results_array>
}
Details of the shape of the objects contained in the <results_array>
can be found in the Jackal Result Guide.
STATUS: 500
HEADERS: Content-Type: application/json
BODY: {
message: 'Cache failed on contracts insertion',
status: 'ERROR',
results: []
}
The Provider Endpoint can be used to run all stored Consumer Contracts for a specified Provider.
METHOD: GET
URL: http://path.to.your.jackal.server:25863/api/contracts/:provider
The :provider
should match the name of the Provider used in any Consumer Contracts previously submitted to Jackal.
STATUS: 200
HEADERS: Content-Type: application/json
BODY: <provider_response>
The <provider_response>
is an object serialised as JSON and has one of three sets of values.
In the case where no contracts are found for the specified Provider, where <provider>
is the name of the specified Provider:
{
message: 'No contracts found for provider: <provider>',
status: 'NO_CONTRACTS',
results: []
}
In the case of Contracts being found for the specified Provider and all contracts passing:
{
message: 'All Passed',
status: 'PASSED',
results: <results_array>
}
Details of the shape of the objects contained in the <results_array>
can be found in the Jackal Result Guide.
In the case of Contracts being found for the specified Provider and at least one contract failing:
{
message: 'Failures Exist',
status: 'FAILED',
results: <results_array>
}
Details of the shape of the objects contained in the <results_array>
can be found in the Jackal Result Guide.
The Statistics Endpoint can be used to retrieve usage statistics for the running Jackal service.
METHOD: GET
URL: http://path.to.your.jackal.server:25863/api/stats
In addition to the basic url above, the Statistics Endpoint can accept a query string consisting of a consumer, a provider or both:
?consumer=<consumer>
?provider=<provider>
?consumer=<consumer>&provider=<provider>
STATUS: 200
HEADERS: Content-Type: application/json
BODY: <statistics>
The <statistics>
are usage statistics for the running Jackal service returned as a serialised JSON object. Details of the shape of the object can be found in the Jackal Statistics Guide.
The Database Endpoint can be used to retrieve the Jackal Database.
METHOD: GET
URL: http://path.to.your.jackal.server:25863/api/db
STATUS: 200
HEADERS: Content-Type: application/json
BODY: <database>
The <database>
is the the current state of the LokiJS database used by Jackal serialised as JSON.