mirror of https://github.com/gophish/gophish
198 lines
5.0 KiB
Plaintext
198 lines
5.0 KiB
Plaintext
|
{
|
||
|
"apiVersion": null,
|
||
|
"swaggerVersion": "1.2",
|
||
|
"basePath": "/api",
|
||
|
"resourcePath": "/templates",
|
||
|
"produces": [
|
||
|
"application/json"
|
||
|
],
|
||
|
"apis": [
|
||
|
{
|
||
|
"path": "/templates/{templateId}",
|
||
|
"operations": [
|
||
|
{
|
||
|
"method": "GET",
|
||
|
"summary": "Find template by ID",
|
||
|
"notes": "Requires an API Key",
|
||
|
"responseClass": "Template",
|
||
|
"nickname": "getTemplateById",
|
||
|
"produces": [
|
||
|
"application/json"
|
||
|
],
|
||
|
"parameters": [
|
||
|
{
|
||
|
"name": "templateId",
|
||
|
"description": "ID of template that needs to be fetched",
|
||
|
"required": true,
|
||
|
"allowMultiple": false,
|
||
|
"dataType": "int64",
|
||
|
"paramType": "path"
|
||
|
}
|
||
|
],
|
||
|
"responseMessages": [
|
||
|
{
|
||
|
"code": 400,
|
||
|
"message": "Invalid API Key"
|
||
|
},
|
||
|
{
|
||
|
"code": 404,
|
||
|
"message": "API Key not set"
|
||
|
},
|
||
|
{
|
||
|
"code": 400,
|
||
|
"message": "Invalid ID supplied"
|
||
|
},
|
||
|
{
|
||
|
"code": 404,
|
||
|
"message": "Template not found"
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"method": "DELETE",
|
||
|
"summary": "Delete template by ID",
|
||
|
"notes": "Requires an API Key",
|
||
|
"responseClass": "void",
|
||
|
"nickname": "deleteTemplate",
|
||
|
"parameters": [
|
||
|
{
|
||
|
"name": "templateId",
|
||
|
"description": "ID of the template that needs to be deleted",
|
||
|
"required": true,
|
||
|
"allowMultiple": false,
|
||
|
"dataType": "int64",
|
||
|
"paramType": "path"
|
||
|
}
|
||
|
],
|
||
|
"responseMessages": [
|
||
|
{
|
||
|
"code": 400,
|
||
|
"message": "Invalid API Key"
|
||
|
},
|
||
|
{
|
||
|
"code": 404,
|
||
|
"message": "API Key not set"
|
||
|
},
|
||
|
{
|
||
|
"code": 400,
|
||
|
"message": "Invalid ID supplied"
|
||
|
},
|
||
|
{
|
||
|
"code": 404,
|
||
|
"message": "Template not found"
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"method": "PUT",
|
||
|
"summary": "Updates the given template",
|
||
|
"notes": "Requires an API Key",
|
||
|
"responseClass": "Template",
|
||
|
"nickname": "putTemplate",
|
||
|
"parameters": [
|
||
|
{
|
||
|
"name": "body",
|
||
|
"description": "Template to be updated",
|
||
|
"required": true,
|
||
|
"allowMultiple": false,
|
||
|
"dataType": "Template",
|
||
|
"paramType": "body"
|
||
|
},
|
||
|
{
|
||
|
"name": "templateId",
|
||
|
"description": "ID of the template that needs to be deleted",
|
||
|
"required": true,
|
||
|
"allowMultiple": false,
|
||
|
"dataType": "int64",
|
||
|
"paramType": "path"
|
||
|
}
|
||
|
],
|
||
|
"responseMessages": [
|
||
|
{
|
||
|
"code": 400,
|
||
|
"message": "Invalid API Key"
|
||
|
},
|
||
|
{
|
||
|
"code": 404,
|
||
|
"message": "API Key not set"
|
||
|
},
|
||
|
{
|
||
|
"code": 400,
|
||
|
"message": "Invalid template supplied"
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"path": "/templates/",
|
||
|
"operations": [
|
||
|
{
|
||
|
"method": "POST",
|
||
|
"summary": "Create a new template",
|
||
|
"notes": "Requires an API Key",
|
||
|
"responseClass": "void",
|
||
|
"nickname": "createTemplate",
|
||
|
"parameters": [
|
||
|
{
|
||
|
"name": "body",
|
||
|
"description": "Template to be added",
|
||
|
"required": true,
|
||
|
"allowMultiple": false,
|
||
|
"dataType": "Template",
|
||
|
"paramType": "body"
|
||
|
}
|
||
|
],
|
||
|
"responseMessages": [
|
||
|
{
|
||
|
"code": 400,
|
||
|
"message": "Invalid API Key"
|
||
|
},
|
||
|
{
|
||
|
"code": 404,
|
||
|
"message": "API Key not set"
|
||
|
},
|
||
|
{
|
||
|
"code": 400,
|
||
|
"message": "Invalid template supplied"
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"method": "GET",
|
||
|
"summary": "Returns all templates owned by the given user",
|
||
|
"notes": "Requires an API Key",
|
||
|
"responseClass": "List[Template]",
|
||
|
"nickname": "getTemplates",
|
||
|
"responseMessages": [
|
||
|
{
|
||
|
"code": 400,
|
||
|
"message": "Invalid API Key"
|
||
|
},
|
||
|
{
|
||
|
"code": 404,
|
||
|
"message": "API Key not set"
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"models": {
|
||
|
"Template": {
|
||
|
"id": "Template",
|
||
|
"properties": {
|
||
|
"name": {
|
||
|
"type" : "string"
|
||
|
},
|
||
|
"id": {
|
||
|
"type": "integer",
|
||
|
"format": "int64"
|
||
|
},
|
||
|
"html": {
|
||
|
"type": "string"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|