2. Event's files
a) Add an image
-
Files related with events must be added using this API.
The file bytcode must be attached to the request and its body must contain the
type
.This is the list of available files
types
:- event_pic
- ticket_pic
- event_banner
- file_upload
POSTPOSTSample request/sellers/:uID/events/:eID/files
/sellers/21/events/32/files
content-type: multipart/form-data; boundary=--------------------------736026379548844049763022 content-length: 393
{ "type": "pdf_path" }
curl -X POST -H "content-type: multipart/form-data; boundary=--------------------------736026379548844049763022" -H "content-length: 393" -d '{"type":"pdf_path"}' -T "empty.pdf" "https://www.courseticket.com/api/v1/sellers/21/events/32/files"
Response 201 Created{ "data": { "pdf_path": "https://cdn.courseticket.com/e/pdf/32-empty.pdf", "file_pdf_path": { "name": "empty.pdf", "type": "application/pdf", "tmp_name": "/var/www/www.courseticket.com/public/app/tmp/phpCyUPxv", "error": 0, "size": 177 }, "pdf_alt": "empty.pdf" } }
-
Making a request without file
type
is not allowedPOSTPOSTSample request/sellers/:uID/events/:eID/files
/sellers/21/events/32/files
content-type: application/json content-length: 20
{ "type": "event_pic" }
curl -X POST -H "content-type: application/json" -H "content-length: 20" -d '{"type":"event_pic"}' "https://www.courseticket.com/api/v1/sellers/21/events/32/files"
Response 400 Bad Request{ "error": "BadRequestException", "error_description": "File must be provided", "code": 400 }
b) Delete a file
-
It is possible to delete files. In case that a file does not exist or an invalid
type
is provided a 404 error is returned.This is the list of available files
types
:- event_pic
- file ID (for file_upload type)
DELDELETESample request/sellers/:uID/events/:eID/files/:type
/sellers/21/events/32/files/pdf_path
curl -X DELETE "https://www.courseticket.com/api/v1/sellers/21/events/32/files/pdf_path"
Response 204 No Content -
Making a request with an invalid file
type
is not allowedDELDELETESample request/sellers/:uID/events/:eID/files/:type
/sellers/21/events/32/files/wrongType
curl -X DELETE "https://www.courseticket.com/api/v1/sellers/21/events/32/files/wrongType"
Response 400 Bad Request{ "error": "BadRequestException", "error_description": "Type not provided or invalid", "code": 400 }
c) Not implemented
-
GET method is not implemented
GETGETSample request/sellers/:uID/events/:eID/files/:type
/sellers/21/events/32/files/event_pic
curl -X GET "https://www.courseticket.com/api/v1/sellers/21/events/32/files/event_pic"
Response 501 Not Implemented{ "error": "NotImplementedException", "error_description": "GET resource not implemented yet", "code": 501 }
-
PATCH method is not implemented
PATCHPATCHSample request/sellers/:uID/events/:eID/files/:type
/sellers/21/events/32/files/event_pic
content-type: application/json content-length: 14
{ "type": "xxx" }
curl -X PATCH -H "content-type: application/json" -H "content-length: 14" -d '{"type":"xxx"}' "https://www.courseticket.com/api/v1/sellers/21/events/32/files/event_pic"
Response 501 Not Implemented{ "error": "NotImplementedException", "error_description": "PATCH not implemented yet", "code": 501 }
-
PUT method is not implemented
PUTPUTSample request/sellers/:uID/events/:eID/files/:type
/sellers/21/events/32/files/event_pic
content-type: application/json content-length: 14
{ "type": "xxx" }
curl -X PUT -H "content-type: application/json" -H "content-length: 14" -d '{"type":"xxx"}' "https://www.courseticket.com/api/v1/sellers/21/events/32/files/event_pic"
Response 501 Not Implemented{ "error": "NotImplementedException", "error_description": "PUT not implemented yet", "code": 501 }