gophish/static/api-doc/resources/campaigns

206 lines
4.8 KiB
Plaintext
Raw Normal View History

{
"apiVersion": null,
"swaggerVersion": "1.2",
"basePath": "http://localhost:3333/api",
"resourcePath": "/campaigns/",
"produces": [
"application/json",
"text/plain"
],
"apis": [
{
"path": "/campaigns/",
"operations": [
{
"method": "GET",
"summary": "Returns all campaigns for the given user",
"notes": "Requires an API key.",
"responseClass": "List[Campaign]",
"nickname" : "getCampaigns",
"produces": [
"application/json",
"text/plain"
],
"responseMessages": [
{
"code": 400,
"message": "Invalid API Key"
},
{
"code": 400,
"message": "API Key not set"
}
],
"deprecated": "false"
},
{
"method": "POST",
"summary": "Create campaign",
"notes": "Requires an API key.",
"responseClass": "Campaign",
"nickname" : "addCampaigns",
"produces": [
"application/json"
],
"parameters": [
{
"name": "body",
"description": "Campaign object that needs to be updated in the store",
"required": true,
"allowMultiple": false,
"dataType": "Campaign",
"paramType": "body"
}
],
"responseMessages": [
{
"code": 400,
"message": "Invalid API Key"
}
],
"deprecated": "false"
}
]
},
{
"path": "/campaigns/{campaignId}",
"operations": [
{
"method": "GET",
"summary": "Find campaign by ID",
"notes": "Returns a campaign based on ID",
"responseClass": "Campaign",
"nickname": "getCampaignById",
"produces": [
"application/json"
],
"parameters": [
{
"name": "campaignId",
"description": "ID of campaign that needs to be fetched",
"required": true,
"allowMultiple": false,
"dataType": "int64",
"paramType": "path"
}
],
"responseMessages": [
{
"code": 400,
"message": "Invalid API Key"
},
{
"code": 400,
"message": "API Key not set"
},
{
"code": 400,
"message": "Invalid campaign id"
},
{
"code": 404,
"message": "Campaign not found"
}
]
},
{
"method": "DELETE",
"summary": "Delete campaign",
"notes": "Requires an API Key",
"responseClass": "void",
"nickname": "deleteCampaign",
"parameters": [
{
"name": "campaignId",
"description": "Campaign id to delete",
"required": true,
"allowMultiple": false,
"dataType": "int64",
"paramType": "path"
}
],
"responseMessages": [
{
"code": 400,
"message": "Invalid API Key"
},
{
"code": 400,
"message": "API Key not set"
},
{
"code": 400,
"message": "Invalid campaign id"
},
{
"code": 404,
"message": "Campaign not found"
}
]
}
]
}
],
"models": {
"Result": {
"id": "Result",
"properties": {
"email": {
"type": "string"
},
"status": {
"type": "string"
}
}
},
"Target": {
"id": "Target",
"properties": {
"email": {
"type": "string"
}
}
},
"Campaign": {
"id": "Campaign",
"properties": {
"name": {
"type": "string"
},
"id": {
"type": "integer",
"format": "int64"
},
"results": {
"type" : "array",
"items" : {
"$ref" : "Result"
}
}
}
},
"Group": {
"id": "Group",
"properties": {
"name": {
"type": "string"
},
"id": {
"type": "integer",
"format": "int64"
},
"targets": {
"type" : "array",
"items" : {
"email" : {
"type" : "string"
}
}
},
"modified_date": {
"type" : "date"
}
}
}
}
}