# Where do i find my extension id?

**URL:** <https://staging-discuss.dev.twitch.com/t/where-do-i-find-my-extension-id/46218>\
**Category:** API\
**Created:** [June 22, 2023, 2:01pm UTC](https://staging-discuss.dev.twitch.com/t/where-do-i-find-my-extension-id/46218 "2023-06-22T14:01:58Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andy](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/andy/32/25168_2.png) [@Andy](https://staging-discuss.dev.twitch.com/u/Andy)\
**Post date:** [June 22, 2023, 2:01pm UTC](https://staging-discuss.dev.twitch.com/t/where-do-i-find-my-extension-id/46218/1 "2023-06-22T14:01:58Z")

</div>

Hello 🙂

i was looking for the extension id but i was not able to find them in the console.

Greetings Andy

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://staging-discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [June 22, 2023, 2:04pm UTC](https://staging-discuss.dev.twitch.com/t/where-do-i-find-my-extension-id/46218/2 "2023-06-22T14:04:12Z")

</div>

![image](https://d2spem0quai2ol.cloudfront.net/original/3X/c/b/cb98eb4ec44e5d7260889e0e693b3fab567ac9b7.png)

---

<div class="post-metadata">

**Author:** ![Andy](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/andy/32/25168_2.png) [@Andy](https://staging-discuss.dev.twitch.com/u/Andy)\
**Post date:** [June 22, 2023, 2:07pm UTC](https://staging-discuss.dev.twitch.com/t/where-do-i-find-my-extension-id/46218/3 "2023-06-22T14:07:25Z")

</div>

yeah i want to call [Reference | Twitch Developers](https://dev.twitch.tv/docs/api/reference/#get-extension-transactions) and there is an extension id as get parameter and a client id so i was a bit confused.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://staging-discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [June 22, 2023, 2:08pm UTC](https://staging-discuss.dev.twitch.com/t/where-do-i-find-my-extension-id/46218/4 "2023-06-22T14:08:32Z")

</div>

The terms can be used interchangebly

---

<div class="post-metadata">

**Author:** ![Andy](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/andy/32/25168_2.png) [@Andy](https://staging-discuss.dev.twitch.com/u/Andy)\
**Post date:** [June 22, 2023, 2:19pm UTC](https://staging-discuss.dev.twitch.com/t/where-do-i-find-my-extension-id/46218/5 "2023-06-22T14:19:36Z")

</div>

ok 🙂 but i get the error “Client ID and OAuth token do not match” but with exact the same clientID the token was created.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://staging-discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [June 22, 2023, 2:20pm UTC](https://staging-discuss.dev.twitch.com/t/where-do-i-find-my-extension-id/46218/6 "2023-06-22T14:20:26Z")

</div>

You did use the Client ID and Extension Client Secret to generate an App Access Token to all the API with

Specifying the ClientID in the header? And The ExtensionID in the params (which is the clientID)

---

<div class="post-metadata">

**Author:** ![Andy](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/andy/32/25168_2.png) [@Andy](https://staging-discuss.dev.twitch.com/u/Andy)\
**Post date:** [June 22, 2023, 2:32pm UTC](https://staging-discuss.dev.twitch.com/t/where-do-i-find-my-extension-id/46218/7 "2023-06-22T14:32:04Z")

</div>

Yes i use the client-id from the box and the client-secret which i have generated. I also get with the exact same data the token.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://staging-discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [June 22, 2023, 2:33pm UTC](https://staging-discuss.dev.twitch.com/t/where-do-i-find-my-extension-id/46218/8 "2023-06-22T14:33:11Z")

</div>

So what does your code look like to make the call with

---

<div class="post-metadata">

**Author:** ![Andy](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/andy/32/25168_2.png) [@Andy](https://staging-discuss.dev.twitch.com/u/Andy)\
**Post date:** [June 22, 2023, 2:33pm UTC](https://staging-discuss.dev.twitch.com/t/where-do-i-find-my-extension-id/46218/9 "2023-06-22T14:33:57Z")

</div>

```auto
function create_app_access_token() {
    // Twitch-Anmeldedaten
    $clientId = 'XXX';
    $clientSecret = 'XXX';

    $tokenURL = 'https://id.twitch.tv/oauth2/token';
    $params = array(
        'client_id' => $clientId,
        'client_secret' => $clientSecret,
        'grant_type' => 'client_credentials'
    );

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $tokenURL);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

    $response = curl_exec($ch);
    curl_close($ch);

    $responseData = json_decode($response, true);
    if (isset($responseData['access_token'])) {
        $accessToken = $responseData['access_token'];
        return $accessToken;
    } else {
        return false;
    }
}

function get_extension_stats() {
    $accessToken = create_app_access_token();
    $extensionID = 'XXX';

    $apiURL = 'https://api.twitch.tv/helix/extensions/transactions';
    $params = array(
        'extension_id' => $extensionID
    );

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $apiURL . '?' . http_build_query($params));
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
        'Client-ID: XXX',
        'Authorization: Bearer ' . $accessToken,
    ));
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $response = curl_exec($ch);
    curl_close($ch);

    // Antwort verarbeiten
    $responseData = json_decode($response, true);
    if (isset($responseData['data'])) {
        $transactions = $responseData['data'];
        var_dump($transactions);
    } else {
        var_dump($responseData);
    }
}

```

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://staging-discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [June 22, 2023, 2:38pm UTC](https://staging-discuss.dev.twitch.com/t/where-do-i-find-my-extension-id/46218/10 "2023-06-22T14:38:36Z")

</div>

> [@Andy](#):
>
> ```auto
> curl_setopt($ch, CURLOPT_HTTPHEADER, array(
> 'Client-ID: XXX',
> 'Authorization: Bearer ' . $accessToken,
> ));
> 
> ```

So you are passing the clientID as `XXX`?

Shouldn’t it be

```auto
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
        'Client-ID: ' . $extensionID,
        'Authorization: Bearer ' . $accessToken,
    ));

```

Also note that clientID’s are essentially public so you don’t need to worry about redacting them

And `$clientId` and `$extensionID` are the same value?

---

<div class="post-metadata">

**Author:** ![Andy](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/andy/32/25168_2.png) [@Andy](https://staging-discuss.dev.twitch.com/u/Andy)\
**Post date:** [June 22, 2023, 2:40pm UTC](https://staging-discuss.dev.twitch.com/t/where-do-i-find-my-extension-id/46218/11 "2023-06-22T14:40:30Z")

</div>

Its working…i was generating a new secret.

---

<div class="post-metadata">

**Author:** ![system](https://d2spem0quai2ol.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://staging-discuss.dev.twitch.com/u/system)\
**Post date:** [July 22, 2023, 2:40pm UTC](https://staging-discuss.dev.twitch.com/t/where-do-i-find-my-extension-id/46218/12 "2023-07-22T14:40:37Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
