# Overview

## Before You Start <a href="#before-you-start" id="before-you-start"></a>

The Offerslook API is designed for developers, engineers, or anyone else who’s comfortable creating custom-coded solutions or integrating with **RESTful APIs**.

## Authentication <a href="#authentication" id="authentication"></a>

There is one authentication methods for the API: [**HTTP Basic authentication**](http://en.wikipedia.org/wiki/Basic_access_authentication). The easiest way to authenticate is using HTTP Basic authentication.&#x20;

### Network API Authentication: Enter network’s name as your username and supply your [**API Key**](https://offerslook.freshdesk.com/support/solutions/articles/14000012737-how-to-generate-network-api-key-on-offerslook-) as the password.

### Affiliate API Authentication: Enter affiliate’s email as your username and supply your [**API Key**](https://offerslook.freshdesk.com/support/solutions/articles/14000012737-how-to-generate-network-api-key-on-offerslook-) as the password.

## JSON <a href="#json" id="json"></a>

The API only supports JSON. So instead of XML, HTTP POST parameters, or other serialization formats, most POST and PATCH requests require a valid JSON object for the body.

## HTTP Methods <a href="#http-methods" id="http-methods"></a>

The API supports 5 [HTTP methods](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) for interacting with resources:

* **GET**

Make a GET request to retrieve data. GET requests will never cause an update or change to your data because they’re safe and [idempotent](http://restcookbook.com/HTTP%20Methods/idempotency/).

* **POST**

Use a POST request to create new resources. For example, make a POST request to a collection endpoint (like /lists) where the body of your request JSON is a new list.

* **PATCH**

Make a PATCH request to update a resource. With PATCH requests, you only need to provide the data you want to change.

* **PUT**

Use a PUT request to create or update a resource. This is most useful for syncing subscriber data.

* **DELETE**

Make a DELETE request to remove a resource.

## SSL <a href="#ssl" id="ssl"></a>

We give a valid, signed certificate for all API methods. If you’re manually coding submit URLs, change http to https in the URL, and make sure your connection library supports HTTPS.

Notice: Offerslook will support SSL within 1-2 month.

## Parameters <a href="#parameters" id="parameters"></a>

There are 4 main categories of parameters for each endpoint in the Offerslook API: path, query string, request body, and response body. The API Reference includes a list of all available parameters for each possible request, but these sections offer an overview of the 4 main categories and their subcategories.

## Errors <a href="#errors" id="errors"></a>

We expose API errors in two ways: standard HTTP response codes and human-readable messages in JSON format. For example, the following code snippet shows an HTTP 405 error in the response headers:

And this snippet shows the human-readable error as a JSON object, we recommend reviewing the Application Error Codes for more context to help you troubleshoot.

For HTTP response codes, 4xx codes suggest a bad request. If you receive a 4xx response, we recommend reviewing the Http Status Codes for more context to help you troubleshoot.

Otherwise, you’re welcome to contact our support team\[<support@offerslook.com>]. If you contact support, we recommend including the complete request you’re trying to make and the error code and response you’re receiving so they can help as quickly as possible.

## Http Status Codes <a href="#http-status-codes" id="http-status-codes"></a>

**Review all global errors for the Offerslook API so you can get back to work fast.**

***401***

**API Key Invalid**

*Your API key may be invalid, or you’ve attempted to access the wrong data center.*

The current request requires user authentication. For example, the user does not have the necessary credentials.

***403***

**No permissions visit this resource.**

*You are not permitted to access this resource.*

The request was a valid request, but the server is refusing to respond to it. For example, the user does not have the necessary permissions for the resource.

***404***

**Resource Not Found**

*The requested resource could not be found.*

This error tells you a specific resource doesn’t exist. It’s possible that the resource has been moved or deleted, or that there’s a typo in your request.

***500***

**Server error,Please contact your administrator**

*A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.Please contact Support for more information.*

This error lets you know our servers have experienced a problem. Although this is rare, please contact <support@offerslook.com> to let us know that you’ve encountered this error.

***501***

**Request uri not found**

*The requested uri resource could not be found.*

The server either does not recognize the request method, or it lacks the ability to fulfill the request.

## Application Error Codes <a href="#application-error-codes" id="application-error-codes"></a>

| code | message                    |
| ---- | -------------------------- |
| 0    | Success                    |
| 11   | Invalid API Key            |
| 12   | Unauthorized Request       |
| 13   | Invalid API Domain         |
| 20   | Request Parameter Error    |
| 30   | Bad Request                |
| 31   | Resource Not Found         |
| 32   | Invalid Request Method     |
| 33   | Duplicated Resource        |
| 40   | Too Many Request           |
| 41   | Request IP Not Whitelisted |
| 42   | Account is locked          |
| 50   | System upgrade             |
| 51   | Server Internal Error      |
| 60   | Illegal Operation          |
