This repository has been archived by the owner on Apr 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
API Documentation
Steven Oud edited this page Feb 28, 2020
·
6 revisions
- Get all discounts
- Search for discount
- Create discount entry
- Upvote/downvote coupon
- Revert upvote/downvote coupon
API endpoint: https://api.schroeff.com/
GET /sites
Status: 200 OK
Content-Type: application/json
[
{
"id": 1,
"site_name": "Spotify",
"product_name": "Spotify Premium",
"url": "https://www.spotify.com/nl/student/",
"thumbnail": "https://www.scdn.co/i/_global/open-graph-default.png",
"description": "50% studenten korting op Spotify Premium",
"discount_requirements": null,
"upvotes": 11,
"downvotes": 1,
"createdAt": "2020-02-25T11:34:08.000Z",
"updatedAt": "2020-02-25T11:35:34.000Z"
},
{
"id": 2,
"site_name": "Adobe",
"product_name": "Adobe Creative Cloud",
"url": "https://www.adobe.com/nl/creativecloud/buy/students.html",
"thumbnail": "https://www.adobe.com/thumb.800.480.png",
"description": "65% korting op Adobe Creative Cloud",
"discount_requirements": null,
"upvotes": 1,
"downvotes": 21,
"createdAt": "2020-02-25T11:34:08.000Z",
"updatedAt": "2020-02-25T11:34:08.000Z"
}
]
GET /sites/search?query=:query
Name | Type | Description |
---|---|---|
query | string | Search query |
Status: 200 OK
Content-Type: application/json
[
{
"id": 1,
"site_name": "Spotify",
"product_name": "Spotify Premium",
"url": "https://www.spotify.com/nl/student/",
"thumbnail": "https://www.scdn.co/i/_global/open-graph-default.png",
"description": "50% studenten korting op Spotify Premium",
"discount_requirements": null,
"upvotes": 11,
"downvotes": 1,
"createdAt": "2020-02-25T11:34:08.000Z",
"updatedAt": "2020-02-25T11:35:34.000Z"
},
{
"id": 3,
"site_name": "Microsoft",
"product_name": "Office 365",
"url": "https://www.microsoft.com/nl-nl/education/products/office",
"thumbnail": null,
"description": "Office 365 gratis",
"discount_requirements": "Studenten e-mail",
"upvotes": null,
"downvotes": null,
"createdAt": "2020-02-25T11:34:08.000Z",
"updatedAt": "2020-02-25T11:34:08.000Z"
}
]
POST /sites
Name | Type | Description |
---|---|---|
site_name | string | Name of the brand or site |
product_name | string | Name of the discounted product (optional) |
url | string | Link to the student discount page |
description | string | Description of discount |
discount_requirements | string | Requirements for getting discount (optional) |
Status: 201 Created
Content-Type: application/json
{
"id": 12,
"site_name": "Google",
"url": "https://google.com",
"thumbnail": null,
"description": "20% faster search as student.",
"discount_requirements": "Need a school e-mail.",
"updatedAt": "2020-02-25T12:35:28.771Z",
"createdAt": "2020-02-25T12:35:28.771Z"
}
PUT /sites/:id/upvote|downvote
Name | Type | Description |
---|---|---|
id | int | Discount ID |
Status: 200 OK
Content-Type: application/json
PUT /sites/:id/upvote|downvote/revert
Name | Type | Description |
---|---|---|
id | int | Discount ID |
Status: 200 OK
Content-Type: application/json