# Getting started with Openprovider API

## Who is Openprovider

Openprovider is a wholesaler of Internet services and products with a unique platform from which you can find and manage all the products you need: Domains, new gTLDs, SSL certificates, licenses for Plesk and Virtuozzo, spam filters, and more!

## Getting started

#### <span>Quick Start Guide to our API</span>

You can find our new Quick Start Guide to our API with just one click [here](https://docs.openprovider.com/doc/all#tag/descCustomerQuickstart)!

Openprovider API gives access to the entire Openprovider infrastructure via a standardised interface based on [OpenAPI Specification](https://github.com/OAI/OpenAPI-Specification). With the help of Openprovider's API, you can do just about anything you can do in [Reseller Control Panel](https://cp.openprovider.eu/).

The Openprovider API is a RESTful API based on HTTPS requests and JSON responses. If you have your Openprovider account, you can obtain your API authentication token via the following endpoint:

```
<span class="s1">POST https://api.openprovider.eu/v1beta/auth/login</span>
```

**NB:** API token TTL is 48 hours

## Endpoints

Openprovider API is accessed by making HTTPS requests to a specific version endpoint URL, in which GET, POST, PUT, and DELETE methods dictate how your interact with the available data. Every endpoint is accessed only via the SSL-enabled HTTPS (port 443) protocol.

Be noted that in order to maintain compatibility in the future, all requests must specify an API version, which is appended to the URL. The [latest version](http://docs.openprovider.com) is v1beta and the base URL for this version's endpoint is:

```
<span class="s1">https://api.openprovider.eu/v1beta/</span>
```

## Authentication

At its current state Openprovider API only supports Bearer Authentication which involves acquiring security tokens that are then passed in a request. This token must be sent in the <span>Authorization</span> header when making requests to protected resources:

```
Authorization: Bearer <token>
```

**Bearer authentication**

```
curl -X POST \<br></br> https://api.openprovider.eu/v1beta/auth/login \<br></br> -d '{"username": "user", "password": "******", "ip": "0.0.0.0"}'
```

```
{<br></br> "data": {<br></br> "token": "6f6d86377bc******feb75cea76d8e8b",<br></br> "reseller_id": 100001<br></br> }<br></br>}
```

Where,

***username***: API/account username (same as RCP username).

***password***: API/account password (same as RCP password of the user).

***ip***: Public IP address from which you will be sending API requests (optional field).

**Note**: If there are multiple contacts (admin/tech/billing) under the reseller account, decide which account/contact you want to use for API connection/integration and use its username and password.

## Responses

All successful responses will be returned as a JSON object with at least one key: data.

The data element will contain either a single JSON object or a list of JSON objects, depending on the endpoint.

```
{<br></br> "data": {<br></br> "id": 11195838,<br></br> "status": "ACT",<br></br> "activation_date": "2019-06-27 04:22:39",<br></br> "renewal_date": "2020-06-25 04:22:39",<br></br> "expiration_date": "2020-06-27 04:22:39",<br></br> "auth_code": "*******"<br></br> },<br></br>}
```

## Moving to Production

You can view [here](https://openprovider.help/books/quick-start/page/how-to-enable-api-access) how to enable your API Access.

**Note**: Our system timezone is set to **CET** (Central European Time). During summer months, it automatically shifts to **CEST (UTC+2)** because of daylight saving time.

- The dates of already created, transferred, or renewed domains or products remain unchanged, regardless of summer time changes.
- However, the summer time change applies to any new domain registrations, renewals, transfers, or products added during that period.