The Unsplash API uses HTTP verbs appropriate to each action performed by a user.| Verb | Description |
|---|
| GET | Retrieving resources. |
| POST | Creating resources. |
| PUT | Updating resources. |
| DELETE | Deleting resources. |
Status Codes & Error Responses#
These API queries return HTTP status codes or error responses that describe the query status.| Status Code | Description |
|---|
| 200-Ok | Everything worked as expected |
| 400- Bad Request | The request was unacceptable, often due to missing a required parameter |
| 401- Unauthorized | Invalid Access Token |
| 403 - Forbidden | Missing permissions to perform request |
| 404 - Not Found | The requested resource doesnโt exist |
| 500, 503 | Something went wrong on our end |
It's important to note that a status 200 - Ok might be returned even when a record is not found or when a wrong param is passed.Always double down with the example response to ensure you getting the right response.
Authorization#
All of the requests that we will be running moving forward will require we pass our applicationโs access key via the HTTP Authorization header.Whenever we pass in client_id as a query param the value will be YOUR_ACCESS_KEY.
So our URL will be something like this ๐