Updating API Document Files (Blueprint/HTML) to have the triple layout as well as an updated blueprint spec

pull/91/head
Jordan Wright 2016-01-11 22:29:11 -06:00
parent 737f41e5c6
commit 6ffbb7b5f8
2 changed files with 686 additions and 419 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,10 +1,10 @@
FORMAT: 1A
HOST: http://localhost:3333/api/
HOST: http://localhost:3333/api
# Gophish API
Gophish was built from the ground-up with a JSON API that makes it easy for developers and sysadmins to automate simulated phishing campaigns.
These docs describe how to use the [gophish](https://github.com/jordan-wright/gophish) API.
These docs describe how to use the [gophish](https://github.com/gophish/gophish) API.
::: note
## Authorization
@ -38,13 +38,30 @@ Campaigns have the following attributes:
+ ```completed_date``` : 2015-1-1T01:02:03.000000Z (datetime) - Date the Campaign was completed
+ ```template``` : [Template](#templates)
+ ```page``` : [Page](#pages) (required) - Landing page for users who click the phishing link
+ ```status``` : Emails Sent (required, string) - The current status of the campaign
+ ```results``` : Attributes (ResultList)
+ ```timeline``` : Attributes (EventList)
+ ```smtp``` : Attributes (SMTP)
+ ```status``` : Emails Sent (string) - The current status of the campaign
+ ```results``` : array[Result] - List of Results for the campaign
+ ```timeline``` : array[Event] - List of Events for the campaign
+ ```smtp``` : [SMTP](#smtp)
+ ```url``` : http://foo.bar (required, string) - The URL used in the Template sent to us
ers
The results of the campaign are stored in the ```results``` field. Each result has the following attributes:
+ ```id``` : 1 (number, required) - Unique identifier
+ ```email``` : foo@example.com - Email address of the target
+ ```first_name``` : John - First name of the target
+ ```last_name``` : Doe - Last name of the target
+ ```status``` : Email Sent - The status of the result
+ ```ip``` : 1.2.3.4 - The IP address that created the event (if any)
+ ```latitude``` : 0.0000- The latitude of the IP address
+ ```longitude``` : 0.0000 - The longitude of the IP address
Each campaign also keeps a timeline of events that occur, such as clicking a link, opening an email, etc. These events each have the following attributes:
+ ```email``` : foo@example.com - Email address of the target
+ ```time``` : 2015-1-1T01:02:03.000000Z (datetime) - The timestamp the event was created
+ ```message``` : Campaign Created (string) - The event message
## Campaigns [/campaigns/]
### Get Campaigns [GET]
@ -52,10 +69,16 @@ Get a list of campaigns.
+ Response 200 (application/json)
+ Attributes (CampaignList)
+ Attributes (array[Campaign])
+ Response 404 (application/json)
+ Body
[]
### Create New Campaign [POST]
Create a new campaign
Create a new campaign.
+ Attributes (Campaign)
@ -103,7 +126,7 @@ Delete a campaign by its ID.
+ Body
{
"message": "Page deleted successfully!",
"message": "Campaign deleted successfully!",
"success": true,
"data": null
}
@ -126,7 +149,7 @@ Templates define what email content is sent to targets during campaigns. It cont
+ ```subject```: Example email template subject (string) - Subject of email sent to users
+ ```text```: `This is a test message!` (string) - Raw text of email sent to users
+ ```html```: `<html><head></head><body>This is a test message!</body></html>` (string) - HTML of email sent to users
+ ```attachments```: Attributes (AttachmentList) - The attachments sent with the email template
+ ```attachments```: array[Attachment] - The attachments sent with the email template
+ ```modified_date```: `2015-01-01T01:02:03.000000Z` (string) - Date the Template was last modified
You can also attach files or payloads to the emails that you send. These are attached as a list of Attachment objects.
@ -144,7 +167,13 @@ Get a list of templates.
+ Response 200 (application/json)
+ Attributes (TemplateList)
+ Attributes (array[Template])
+ Response 404 (application/json)
+ Body
[]
### Create New Template [POST]
Create a new template
@ -224,7 +253,7 @@ Groups contain the details for one or more users targeted in the simulated phish
+ ```id```: 1 (required, number) - Unique identifier
+ ```name```: Example Group (required) - Name of the Group
+ ```modified_date```: `2015-01-01T01:02:03.000000Z` (string) - Date the Group was last modified
+ ```targets```: Attributes (TargetList) (required) - The targets in the group
+ ```targets```: Attributes (array[Target]) (required) - The targets in the group
Each target contains the following attributes:
@ -248,7 +277,13 @@ Get a list of groups.
+ Response 200 (application/json)
+ Attributes (GroupList)
+ Attributes (array[Group])
+ Response 404 (application/json)
+ Body
[]
### Create New Group [POST]
Create a new group
@ -333,7 +368,13 @@ Get a list of pages.
+ Response 200 (application/json)
+ Attributes (PageList)
+ Attributes (array[Page])
+ Response 404 (application/json)
+ Body
[]
### Create New Page [POST]
Create a new page
@ -393,6 +434,10 @@ Modify a page by its ID.
"data": null
}
+ Response 400 (application/json)
+ Attributes (BadRequestResponse)
### Delete a Page [DELETE]
Delete a page by its ID.
@ -449,7 +494,7 @@ The fields expected in the CSV are as follows:
+ Response 201 (application/json)
+ Attributes (TargetList)
+ Attributes (array[Target])
+ Response 400 (application/json)
@ -521,15 +566,11 @@ To keep styles, images, and Javascript setup and working, gophish adds a ```base
+ email: john.doe@example.com - Email address of Target
+ position: System Administrator - Company position of the Target
## TargetList (array[Target])
## Group (object)
+ id: 1 (number, required) - Unique identifier
+ name: Example Group (required) - Name of the Group
+ modified_date: `2015-01-01T01:02:03.000000Z` (string) - Date the Group was last modified
+ targets: (TargetList, required) - The targets in the group
## GroupList (array[Group])
+ targets: array[Target] (required) - The targets in the group
## Attachment (object)
+ id: 1 (number, required) - Unique identifier
@ -537,41 +578,43 @@ To keep styles, images, and Javascript setup and working, gophish adds a ```base
+ content: (string, required) - Base64 encoded attachment content
+ type: `text/plain` (string, required) - MIME type of the Attachment
## AttachmentList (array[Attachment])
## Template (object)
+ id: 1 (number, required) - Unique identifier
+ name: Example Template (string, required) - Name of template
+ subject: Example email template subject (string) - Subject of email sent to users
+ text: `This is a test message!` (string) - Raw text of email sent to users
+ html: `<html><head></head><body>This is a test message!</body></html>`(string) - HTML of email sent to users
+ attachments: (AttachmentList) - The attachments sent with the email template
+ attachments: (array[Attachment]) - The attachments sent with the email template
+ modified_date: `2015-01-01T01:02:03.000000Z` (string) - Date the Template was last modified
## TemplateList (array[Template])
## Page (object)
+ id: 1 (number, required) - Unique identifier
+ name: Example Page (string, required) - Name of Page
+ html: `<html><head></head><body>This is a test message!</body></html>` (required, string) - HTML of the landing page users hit when clicking links in the email template
+ modified_date: `2015-01-01T01:02:03.000000Z` (string) - Date the Page was last modified
## PageList (array[Page])
## Result (object)
+ id: 1 (number, required) - Unique identifier
+ something: Something (string, required) - Something
## ResultList (array[Result])
+ email: foo@example.com - The email address of the target
+ first_name: John - First name of the target
+ last_name: Doe - Last name of the target
+ status: Email Sent - The status of the result
+ ip: 1.2.3.4 - The IP address that created the event (if any)
+ latitude: 0.00000 (number) - The latitude of the IP address
+ longitude: 0.00000 (number) - The longitude of the IP address
## Event (object)
+ id: 1 (number, required) - Unique identifier
+ Else: Else (string) - Else
## EventList (array[Event])
+ email: foo@example.com (required) - The email address of the target
+ time: `2015-01-01T01:02:03.000000Z` (string) - Date the event was generated
+ message: Campaign Created (string) - The description of the event
## SMTP (object)
+ id: 1 (number, required) - Unique identifier
+ host: smtp.example.com:25 (required) - The hostname and port for the SMTP server
+ username: foo (string, required) - The username used for SMTP authentication
+ password: bar (string, required) - The password used for SMTP authentication
+ from_address: John Doe <foo@example.com> (string, required) - The "From" address to spoof
## Campaign (object)
+ id: 1 (number, required) - Unique identifier
@ -579,15 +622,13 @@ To keep styles, images, and Javascript setup and working, gophish adds a ```base
+ created_date: `2015-01-01T01:02:03.000000Z` (string) - Date the Campaign was created
+ completed_date: `2015-01-01T01:02:03.000000Z` (string) - Date the Campaign was completed
+ template: (Template) (required) - Email template to use in Campaign
+ page: Attributes (Page) (required) - Landing page for users who click the phishing link
+ page: (Page) (required) - Landing page for users who click the phishing link
+ status: Emails Sent (required, string) - The current status of the campaign
+ results: (ResultList) - The results of the campaign
+ timeline: (EventList) - The event timeline
+ results: (array[Result]) - The results of the campaign
+ timeline: (array[Event]) - The event timeline
+ smtp: (SMTP) - The SMTP settings used in the campaign
+ url: http://foo.bar (string, required) - The URL used in the Template sent to users
## CampaignList (array[Campaign])
## ImportSiteRequest (object)
+ url: http://foo.bar (string, required) - The URL to be retrieved
@ -600,7 +641,7 @@ To keep styles, images, and Javascript setup and working, gophish adds a ```base
+ subject: Foo Bar (string) - The email subject
## BadRequestResponse (object)
+ message: "Error message" (string) - The detailed error message
+ message: Error message (string) - The detailed error message
+ success: false (boolean) - The success status of the request
+ data: Any associated data