# Get promotion by operator ID

Using the `/promotions/operators/{operatorid}` endpoint, you can get the details of every promotion on an operator

## Promotion by operator ID

<mark style="color:blue;">`GET`</mark> `https://topups.reloadly.com/promotions/operators/{operatorid}`

#### Path Parameters

| Name       | Type    | Description                                                           |
| ---------- | ------- | --------------------------------------------------------------------- |
| operatorId | integer | The ID of the operator whose promotion information is being retrieved |

#### Headers

| Name          | Type   | Description                                                             |
| ------------- | ------ | ----------------------------------------------------------------------- |
| Authorization | string | Your access token is required as a bearer token in the request's header |

{% tabs %}
{% tab title="200 This response is gotten when a successful request is made and a list of active promotions on an operator is received" %}
{% tabs %}
{% tab title="JSON" %}

```bash
[
  {
    "id":8934,
    "promotionId":8934,
    "operatorId":344,
    "title":"Glo Mobile Nigeria From 06 Jun 2021 00:00 To 31 Jul 2021 23:59 (GMT+01:00)",
    "title2":"Bonus 400% and 500%",
    "description":"<u><strong>Glo Nigeria Promotions!</strong></u><br /><strong>400% and 500% bonus for International top Ups today!&nbsp;</strong><br /><br /><strong>How it works</strong><br />If a customer wants to get 4X bonus, the customer will recharge N125 (N100 +25) to get N500, or recharge N1025 (N1000 + 25) to get N4100<br />&nbsp;<br />If a customer wants to get 5X bonus, the customer will recharge N120 (N100 +20) to get N600, or recharge N2020 (N2000 + 20) to get N10,100<br />&nbsp;<br />The addition of N25 or N20 to the original amount (N100 or N500 or N2000) is what triggers the application of the bonus to the recipient.<br /><br /><strong>Terms and Conditions</strong><br />* Bonus is valid for 14 and 30 days on specific denominations (See table below)<br />*&nbsp;Bonus Airtime can only be used to make local calls to all network, but not subscribe for data bundles.<br />* To check your 4X Bonus account dial #122*30#<br />&nbsp;* To check your 5X Bonus account dial #555*5#<br /><br /><img alt=\"\" src=\"https://i.postimg.cc/5NF3gKps/Glo-Voice-Bonus-Products.png\" style=\"height:423px; width:752px\" />",
    "startDate":"2021-06-06 03:00:00",
    "endDate":"2021-08-01 02:59:00",
    "denominations":null,
    "localDenominations":null
  }
]
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="401 This response is gotten when an incorrect or expired access token is used to make a request" %}
{% tabs %}
{% tab title="JSON" %}

```bash
{
  "timeStamp":"2021-06-09 20:13:16",
  "message":"Full authentication is required to access this resource",
  "path":"/promotions/operators/344",
  "errorCode":"INVALID_TOKEN",
  "infoLink":null,
  "details":[
    
  ]
}
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="404 This response is gotten when a request is made to an incorrect URL path" %}
{% tabs %}
{% tab title="JSON" %}

```bash
{
  "timestamp":"2021-06-09T20:17:45.467+0000",
  "status":404,
  "error":"Not Found",
  "message":"No message available",
  "path":"/promotions/operator/344"
}
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

### Request samples

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location --request GET 'https://topups.reloadly.com/promotions/operators/129' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN_HERE' \
--header 'Accept: application/com.reloadly.topups-v1+json' 
```

{% endtab %}

{% tab title="C#" %}

```csharp
using System;
using System.Threading.Tasks;
using System.Net.Http;
using System.Text;
using Newtonsoft.Json;

namespace WebAPIClient {
  class Program {

    static async Task Main(string[] args) {
      await ApiCall();
    }

    private static async Task ApiCall() {

      var message = new HttpRequestMessage(HttpMethod.Get, "https://topups.reloadly.com/promotions/operators/129");

      message.Headers.TryAddWithoutValidation("Authorization", "Bearer YOUR_ACCESS_TOKEN_HERE");
      message.Headers.TryAddWithoutValidation("Accept", "application/com.reloadly.topups-v1+json");

      using
      var httpClient = new HttpClient();
      var response = await httpClient.SendAsync(message);
      var responseBody = await response.Content.ReadAsStringAsync();
      var result = JsonConvert.DeserializeObject < dynamic > (responseBody);

      Console.WriteLine(result);
    }

  }
}
```

{% endtab %}

{% tab title="Golang" %}

```go
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://topups.reloadly.com/promotions/operators/129"
  method := "GET"

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, nil)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN_HERE")
  req.Header.Add("Accept", "application/com.reloadly.topups-v1+json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```

{% endtab %}

{% tab title="Java" %}

```java
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
Request request = new Request.Builder()
  .url("https://topups.reloadly.com/promotions/operators/129")
  .method("GET", null)
  .addHeader("Authorization", "Bearer YOUR_ACCESS_TOKEN_HERE")
  .addHeader("Accept", "application/com.reloadly.topups-v1+json")
  .build();
Response response = client.newCall(request).execute();
```

{% endtab %}

{% tab title="Node JS" %}

```javascript
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://topups.reloadly.com/promotions/operators/129',
  'headers': {
    'Authorization': 'Bearer YOUR_ACCESS_TOKEN_HERE',
    'Accept': 'application/com.reloadly.topups-v1+json',
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://topups.reloadly.com/promotions/operators/129',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer YOUR_ACCESS_TOKEN_HERE',
    'Accept: application/com.reloadly.topups-v1+json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = "https://topups.reloadly.com/promotions/operators/129"

payload={}
headers = {
  'Authorization': 'Bearer YOUR_ACCESS_TOKEN_HERE',
  'Accept': 'application/com.reloadly.topups-v1+json'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
```

{% endtab %}
{% endtabs %}

### Response parameters

| Parameter            | Type    | Description                                                                                          |
| -------------------- | ------- | ---------------------------------------------------------------------------------------------------- |
| `promotionId`        | integer | The promotion ID. This is a unique identifier for the ongoing promotion                              |
| `operatorId`         | integer | Indicates the ID of the operator offering the promotion                                              |
| `title1`             | string  | Indicates the duration of the promotion and the name of the operator offering it                     |
| `title2`             | string  | Indicates additional information on the promotion                                                    |
| `description`        | string  | Indicates a summary of what the promotion is about                                                   |
| `startDate`          | string  | The date the promotion begins                                                                        |
| `endDate`            | string  | The date the promotion ends                                                                          |
| `denominations`      | string  | Indicates the top-up amounts that are eligible for the promotion                                     |
| `localDenominations` | string  | Indicates the local top-up amounts in the destination's currency that are eligible for the promotion |
