# Show active patron names on my wordpress website

**URL:** <https://www.patreondevelopers.com/t/show-active-patron-names-on-my-wordpress-website/7469>\
**Category:** Wordpress Plugin\
**Created:** [May 20, 2023, 10:13pm UTC](https://www.patreondevelopers.com/t/show-active-patron-names-on-my-wordpress-website/7469 "2023-05-20T22:13:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pbrmaterials](https://avatars.discourse-cdn.com/v4/letter/p/e9c0ed/32.png) [@pbrmaterials](https://www.patreondevelopers.com/u/pbrmaterials)\
**Post date:** [May 20, 2023, 10:13pm UTC](https://www.patreondevelopers.com/t/show-active-patron-names-on-my-wordpress-website/7469/1 "2023-05-20T22:13:41Z")

</div>

Hello how can i show my active patron names on my wordpress site.

i use this code but i am getting error because of campaign id

function display\_patreon\_supporters() {  
// Retrieve the Patreon API access token  
$access\_token = ‘TOKEN’;

```
// Set up the API request
$api_url = 'https://www.patreon.com/api/oauth2/v2/campaigns/CAMPAIGN_ID/members';
$headers = array(
    'Authorization' => 'Bearer ' . $access_token,
);

// Make the API request
$response = wp_remote_get($api_url, array('headers' => $headers));

// Check if the request was successful
if (!is_wp_error($response) && $response['response']['code'] === 200) {
    $body = json_decode($response['body'], true);
    
    // Retrieve the list of patrons/supporters
    $supporters = $body['data'];
    if (!empty($supporters)) {
        // Display the supporter names
        echo '<ul>';
        foreach ($supporters as $supporter) {
            echo '<li>' . $supporter['attributes']['full_name'] . '</li>';
        }
        echo '</ul>';
    } else {
        echo 'No supporters found.';
    }
} else {
    echo 'Failed to retrieve supporters.';
}

```

}

add\_shortcode(‘patreon\_supporters’, ‘display\_patreon\_supporters’);

thank you

---

<div class="post-metadata">

**Author:** ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)\
**Post date:** [May 23, 2023, 6:04pm UTC](https://www.patreondevelopers.com/t/show-active-patron-names-on-my-wordpress-website/7469/2 "2023-05-23T18:04:30Z")

</div>

You can get your campaign id via your own /identity response or campaign details by directly requesting that info as relation for your identity etc.

Also you need to paginate your members. Check how the WP plugin does it for posts - works the same:

> <https://github.com/Patreon/patreon-wordpress/blob/e5c0656b5e0631abbfa93b18ca110c7abd1aafab/classes/patreon_api_v2.php#L122>
