...
Drawio | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
3. API definition guide
Template CRUD operations
Create xpath template
Interface definition | Description |
---|---|
Content-Type | application/json |
Operation | POST |
URI | /api/v1/templates |
Request Body
Attribute | Required | Type | Description |
---|---|---|---|
id | Y | String | Identifier for the template |
schema-set | Y | String | schema set on which xpath query should be executed |
template | Y | String | xpath template |
Response Codes
Code | Description |
---|---|
201 | Template created successfully |
400 | Bad Request (Error in request attributes) |
500 | Internal server error |
List all xpath template
Interface definition | Description |
---|---|
Content-Type | application/json |
Operation | GET |
URI | /api/v1/templates |
Response Codes
Code | Description |
---|---|
200 | Templates returned successfully |
404 | No templates found |
500 | Internal server error |
Response Body
Attribute | Required | Type | Description |
---|---|---|---|
templates | Y | List | List of template objects |
Template Object
Attribute | Required | Type | Description |
---|---|---|---|
id | Y | String | Identifier for the template |
schema-set | Y | String | schema set on which xpath query should be executed |
template | Y | String | xpath template |
Get a xpath template by id
Interface definition | Description |
---|---|
Content-Type | application/json |
Operation | GET |
URI | /api/v1/templates/{schema-set}/{id} |
Response Codes
Code | Description |
---|---|
200 | Template found and returned |
404 | Template not found |
500 | Internal server error |
Response Body
Same as template Object
Delete xpath template
Interface definition | Description |
---|---|
Content-Type | application/json |
Operation | DELETE |
URI | /api/v1/templates/{schema-set}/{id} |
Response Codes
Code | Description |
---|---|
200 | Template deleted successfully |
400 | Bad Request (Error in request attributes) |
500 | Internal server error |
Execute template
Interface definition | Description |
---|---|
Content-Type | application/json |
Operation | POST |
URI | /api/v1/execute/{schema-set}/{id} |
Request Body
Attribute | Required | Type | Description |
---|---|---|---|
Input | Y | JSON blob | Input dictionary to be applied to the template |
Response Codes
Code | Description |
---|---|
200 | Template executed successfully |
400 | Bad Request (Error in request attributes) |
500 | Internal server error |
Response Body
Attribute | Required | Type | Description |
---|---|---|---|
result | Y | JSON Blob | Result of the xpath query as JSON object |
4. Dependencies
- Definition of templates
5. Deployment aspects
To be updated