Form tickets
Summary of form tickets endpoints
- GET /admin/api/tickets - list all available tickets.
- GET /admin/api/forms/1/tickets - list all available tickets for requested form.
- GET /admin/api/forms/1/tickets/1 - get data for a single ticket.
- DELETE /admin/api/forms/1/tickets/1 - remove a ticket.
- DELETE /admin/api/forms/1/tickets/delete_spam - remove all spam ticket for requested form.
- DELETE /admin/api/forms/1/tickets/delete_tickets - remove all or part of tickets for requested form.
Related endpoints:
List all available tickets
GET /admin/api/tickets
By default, this requests returns a list of all tickets (spam and non spam) (newer first).
Example response:
Status: 200 OK
[
{
"id": 2,
"spam": false,
"created_at": "2014-02-07T16:06:45.000Z",
"updated_at": "2014-02-07T16:06:45.000Z",
"url": "http://helloworld.voog.co/admin/api/forms/1/tickets/2",
"form": {
"id": 1,
"title": "Form page",
"created_at": "2014-02-07T11:22:01.000Z",
"updated_at": "2014-02-07T13:06:19.000Z",
"url": "http://helloworld.voog.co/admin/api/forms/1"
},
"user_country": "us",
"user_city": "Phoenix",
"user_language": "en-US",
"user_latitude": "33.6748",
"user_longitude": "-111.9519",
"data": {
"field_1386926728322": "test2@example.cpm",
"field_1386926764566": "Choice 1",
"field_1386926768551": "Text\nArea",
"field_1391778363674": null
}
}, {
"id": 1,
"spam": false,
"created_at": "2014-02-07T15:08:49.000Z",
"updated_at": "2014-02-07T15:08:49.000Z",
"url": "http://helloworld.voog.co/admin/api/forms/1/tickets/1",
"form": {
"id": 1,
"title": "Form page",
"created_at": "2014-02-07T11:22:01.000Z",
"updated_at": "2014-02-07T13:06:19.000Z",
"url": "http://helloworld.voog.co/admin/api/forms/1"
},
"user_country": "us",
"user_city": "Phoenix",
"user_language": "en-US",
"user_latitude": "33.6748",
"user_longitude": "-111.9519",
"data": {
"field_1386926728322": "test@example.cpm",
"field_1386926764566": "Choice 3",
"field_1386926768551": "Text\nArea",
"field_1391778363674": {
"file_name": "report.pdf",
"url": "http://helloworld.voog.co/admin/content/forms/aTxj4chkBwABBQB930c0e448c8bdc7fe6d67d0eaf2f1d8964af2XXEC/attachment"
}
}
}
]
Parameters
per_page
- elements per response (default:50
; maximum:250
).page
- requested page (default:1
).form_id
- filter by form ID.page_id
- filter by page ID, where form is located.not_spam
- if present then returns only non spam tickets. (eg?not_spam=1
).spam
- if present then returns only spam tickets. (eg?spam=1
).
Filter attributes
Read more about filters.
- Object
ticket
attributes:id
,spam
,user_country
,user_city
,user_language
,user_latitude
,user_longitude
,created_at
,updated_at
.
List all available tickets for requested form
GET /admin/api/forms/1/tickets
By default, this requests returns a list of all tickets (spam and non spam) for the requested form (newer first).
Example response:
Status: 200 OK
[
{
"id": 2,
"spam": false,
"created_at": "2014-02-07T16:06:45.000Z",
"updated_at": "2014-02-07T16:06:45.000Z",
"url": "http://helloworld.voog.co/admin/api/forms/1/tickets/2",
"form": {
"id": 1,
"title": "Form page",
"created_at": "2014-02-07T11:22:01.000Z",
"updated_at": "2014-02-07T13:06:19.000Z",
"url": "http://helloworld.voog.co/admin/api/forms/1"
},
"user_country": "us",
"user_city": "Phoenix",
"user_language": "en-US",
"user_latitude": "33.6748",
"user_longitude": "-111.9519",
"data": {
"field_1386926728322": "test2@example.cpm",
"field_1386926764566": "Choice 1",
"field_1386926768551": "Text\nArea",
"field_1391778363674": null
}
}, {
"id": 1,
"spam": false,
"created_at": "2014-02-07T15:08:49.000Z",
"updated_at": "2014-02-07T15:08:49.000Z",
"url": "http://helloworld.voog.co/admin/api/forms/1/tickets/1",
"form": {
"id": 1,
"title": "Form page",
"created_at": "2014-02-07T11:22:01.000Z",
"updated_at": "2014-02-07T13:06:19.000Z",
"url": "http://helloworld.voog.co/admin/api/forms/1"
},
"user_country": "us",
"user_city": "Phoenix",
"user_language": "en-US",
"user_latitude": "33.6748",
"user_longitude": "-111.9519",
"data": {
"field_1386926728322": "test@example.cpm",
"field_1386926764566": "Choice 3",
"field_1386926768551": "Text\nArea",
"field_1391778363674": {
"file_name": "report.pdf",
"url": "http://helloworld.voog.co/admin/content/forms/aTxj4chkBwABBQB930c0e448c8bdc7fe6d67d0eaf2f1d8964af2XXEC/attachment"
}
}
}
]
Parameters
per_page
- elements per response (default:50
; maximum:250
).page
- requested page (default:1
).not_spam
- if present then returns only non spam tickets. (eg?not_spam=1
).spam
- if present then returns only spam tickets. (eg?spam=1
).
Filter attributes
Read more about filters.
- Object
ticket
attributes:id
,spam
,user_country
,user_city
,user_language
,user_latitude
,user_longitude
,created_at
,updated_at
.
Get data for a single ticket
GET /admin/api/forms/1/tickets/1
Example request:
GET http://helloworld.voog.co/admin/api/forms/1/tickets/2
Example response:
Status: 200 OK
{
"id": 1,
"spam": false,
"created_at": "2014-02-07T15:08:49.000Z",
"updated_at": "2014-02-07T15:08:49.000Z",
"url": "http://helloworld.voog.co/admin/api/forms/1/tickets/1",
"form": {
"id": 1,
"title": "Form page",
"created_at": "2014-02-07T11:22:01.000Z",
"updated_at": "2014-02-07T13:06:19.000Z",
"url": "http://helloworld.voog.co/admin/api/forms/1"
},
"user_country": "us",
"user_city": "Phoenix",
"user_language": "en-US",
"user_latitude": "33.6748",
"user_longitude": "-111.9519",
"data": {
"field_1386926728322": "test@example.cpm",
"field_1386926764566": "Choice 3",
"field_1386926768551": "Text\nArea",
"field_1391778363674": {
"file_name": "report.pdf",
"url": "http://helloworld.voog.co/admin/content/forms/aTxj4chkBwABBQB930c0e448c8bdc7fe6d67d0eaf2f1d8964af2XXEC/attachment"
}
}
}
Remove a ticket
DELETE /admin/api/forms/1/tickets/1
This request deletes the ticket from the database.
Example request:
DELETE http://helloworld.voog.co/admin/api/forms/1/tickets/1
Example response:
Status: 204 No Content
Remove all spam ticket for requested form
DELETE /admin/api/forms/1/tickets/delete_spam
This request deletes all tickets flagged as spam under given form.
Example request:
DELETE http://helloworld.voog.co/admin/api/forms/1/tickets/delete_spam
Example response:
Status: 200 OK
{
"deleted_count": 1
}
Remove all or part of tickets for requested form
DELETE /admin/api/forms/1/tickets/delete_tickets
This request deletes all or part of tickets (specified using ticket_ids
parameter) under given form.
Example request:
DELETE http://helloworld.voog.co/admin/api/forms/1/tickets/delete_tickets
Example data:
{
"ticket_ids": [1]
}
Example response:
Status: 200 OK
{
"deleted_count": 1
}
Parameters
ticket_ids
- array of ticket ids that should be deleted (optional). If not provided then all tickets of requested form are deleted.