gophish/static/api-doc/resources/campaigns

257 lines
5.7 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": "Add a new 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": "DELETE",
"summary": "Deletes a 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"
}
]
},
{
"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"
}
]
}
]
}
],
"models": {
"Result": {
"id": "Result",
"properties": {
"target": {
"$ref": "Target"
},
"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" : {
"$ref" : "Target"
}
},
"modified_date": {
"type" : "date"
}
}
},
"Pet": {
"id": "Pet",
"description": "A pet is a person's best friend",
"required": [
"name",
"id"
],
"properties": {
"name": {
"type": "string"
},
"tags": {
"type": "array",
"items": {
"$ref": "Tag"
}
},
"photoUrls": {
"type": "array",
"items": {
"type": "string"
}
},
"id": {
"type": "integer",
"format": "int64"
},
"status": {
"type": "string",
"description": "pet status in the store",
"enum": [
"available",
"pending",
"sold"
]
},
"category": {
"$ref": "Category"
}
}
},
"Category": {
"id": "Category",
"properties": {
"name": {
"type": "string"
},
"id": {
"type": "integer",
"format": "int64"
}
}
}
}
}