AdvertiserCompany API
Creating a new AdvertiserCompany
An advertiserCompany is created by sending a POST request to
/api/ui/advertisercompanies using content-type JSON.
Mandatory fields are:
invoiceType
Success is indicated with status code 201. The object that contains its unique identifier is returned. Failure due to a badly formed user request will return an empty body and status code 400.
request:
POST /api/ui/advertisercompanies
Content-Type: application/json
Body:
{
"invoiceType": 1,
"name": "Fubar co",
"quote": null,
"address": "Rue bar",
"number": "77",
"zip": "9000",
"city": "Gent",
"country": "",
"vat": "",
"tel": "",
"fax": "",
"email": "",
"commission": 0,
"vatPercentage": -1,
"amsNumber": "ams001"
}
Successful response:
Status: 201 CREATED
Content-Type: application/json
Body:
{
"id": 5,
"invoiceType": 1,
...
}
Retrieving an existing advertiserCompany
A single advertiserCompany with a known unique identifier can be retrieved by sending a GET request
/api/ui/advertisercompanies/{id}
where {id} is the unique identifier of the advertiserCompany. Success is indicated with status code 200. The advertiserCompany is returned with its unique identifier.
GET /api/ui/advertisercompanies/1
Successful response:
Status: 200 OK
Content-Type: application/json
Body:
{
"id": 1,
"invoiceType": 1,
"name": "Foo papier",
"quote": null,
"address": "Prof. P.Q. DIngeslaan",
"number": "778",
"zip": "2000",
"city": "Antwerpen",
"country": "BE",
"vat": "",
"tel": "",
"fax": "",
"email": "jeff@foopapier.be",
"commission": 0,
"vatPercentage": -1,
"amsNumber": "ams001"
}
If no advertiserCompany with the requested unique identifier exists, status code 404 is returned
Modifying an AdvertiserCompany
A previously created advertiserCompany is modified by sending a PUT request
/api/ui/advertisercompanies/{id}
using content-type JSON, where {id} is the unique identifier of the advertiserCompany.
The ID in the request body MUST be identical to the unique identifier in the request path. Success is indicated with status code 204. No body is returned. Failure due to user error is indicated by status code 400.
request:
PUT /api/ui/advertisercompanies/17
Content-Type: application/json
Body:
{
"id": 1,
"invoiceType": 1,
"name": "Foo papier",
"quote": null,
"address": "Prof. P.Q. DIngeslaan",
"number": "779",
"zip": "2000",
"city": "Antwerpen",
"country": "BE",
"vat": "",
"tel": "",
"fax": "",
"email": "jules@foopapier.be",
"commission": 0,
"vatPercentage": -1,
"amsNumber": "ams001"
}
Successful response:
Status: 204 NO_CONTENT
Performing a search on AdvertiserCompany
A List of AdvertiserCompanies matching a search criteria can be retrieved by sending a GET request
/api/ui/advertisercompanies/search?name={query}
where {query} is the search string. Success is indicated with status code 200.
GET /api/ui/advertisercompanies/search?name=foo
successful response:
Status: 200 OK
Content-Type: application/json
Body:
[
]
Deleting an AdvertiserCompany
A previously created advertiserCompany is deleted by sending a DELETE request to
/api/ui/advertisercompanies/{id}
where {id} is the unique identifier of the advertiserCompany. Success is indicated with status code 204. No body is returned. Failure due to user error is indicated by a status code of 400.
request:
DELETE /api/ui/advertisercompanies/1
successful response:
Status: 204 NO_CONTENT