# Transfer account ownership resulted in broken Rest API for server-to-server Oauth

**URL:** <https://devforum.zoom.us/t/transfer-account-ownership-resulted-in-broken-rest-api-for-server-to-server-oauth/96609>\
**Category:** API and Webhooks\
**Tags:** server-to-server\
**Created:** [October 11, 2023, 3:12pm UTC](https://devforum.zoom.us/t/transfer-account-ownership-resulted-in-broken-rest-api-for-server-to-server-oauth/96609 "2023-10-11T15:12:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![eric.petersson](https://avatars.discourse-cdn.com/v4/letter/e/c4cdca/32.png) [@eric.petersson](https://devforum.zoom.us/u/eric.petersson)\
**Post date:** [October 11, 2023, 3:12pm UTC](https://devforum.zoom.us/t/transfer-account-ownership-resulted-in-broken-rest-api-for-server-to-server-oauth/96609/1 "2023-10-11T15:12:24Z")

</div>

Hi!

We recently switched ownership for a server-to-server Oath app we created for client my account to the owner of the client’s Zoom domain. This Oauth app was meant for usage of the Webinars/Meetings Rest API to make registrants at our client’s website possible directly into Zoom.

After the owner switch, our Bearer authentication in our Rest API in C# stopped working and now we only receive 400 request from the server.

Is there something we are missing? The Oauth app did not seem to have change credentials for the Account Id, Client secret and Client Id.

---

<div class="post-metadata">

**Author:** ![eric.petersson](https://avatars.discourse-cdn.com/v4/letter/e/c4cdca/32.png) [@eric.petersson](https://devforum.zoom.us/u/eric.petersson)\
**Post date:** [October 11, 2023, 3:13pm UTC](https://devforum.zoom.us/t/transfer-account-ownership-resulted-in-broken-rest-api-for-server-to-server-oauth/96609/2 "2023-10-11T15:13:00Z")

</div>

Here is how we manage the call in our C# application:

public async Task GetZoomAccessToken(string zoomUrl = “”, string clientId = “”, string clientSecret = “”, string accountId = “”)  
{  
zoomUrl = string.IsNullOrWhiteSpace(zoomUrl) ? \_appSettings.ZoomBaseUrl : zoomUrl;  
clientId = string.IsNullOrWhiteSpace(clientId) ? \_appSettings.ZoomClientId : clientId;  
clientSecret = string.IsNullOrWhiteSpace(clientSecret) ? \_appSettings.ZoomClientSecret : clientSecret;  
accountId = string.IsNullOrWhiteSpace(accountId) ? \_appSettings.ZoomAccountId : accountId;

```
    var zoomOuathUrl = $"{zoomUrl}/oauth/token";

    var base64Auth = Convert.ToBase64String(Encoding.UTF8.GetBytes($"{clientId}:{clientSecret}"));

    using (HttpClient client = new())
    {
        client.DefaultRequestHeaders.Add("Host", "zoom.us");
        client.DefaultRequestHeaders.Add("Authorization", $"Basic {base64Auth}");

        var content = new FormUrlEncodedContent(new Dictionary<string, string>
        {
            { "grant_type", "account_credentials" },
            { "account_id", accountId }
        });

        HttpResponseMessage response = await client.PostAsync(zoomOuathUrl, content);

        if (response.IsSuccessStatusCode)
        {
            var responseContent = await response.Content.ReadAsStringAsync();
            var tokenResponse = JsonSerializer.Deserialize<ZoomTokenResponse>(responseContent);

            return tokenResponse?.access_token;
        }
        else
        {
            return null;
        }
    }
}

```

}

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [October 11, 2023, 3:55pm UTC](https://devforum.zoom.us/t/transfer-account-ownership-resulted-in-broken-rest-api-for-server-to-server-oauth/96609/3 "2023-10-11T15:55:02Z")

</div>

Hi @eric.petersson , please verify that the new account has all the permissions enabled to use S2S: [Internal apps (Server-to-server)](https://developers.zoom.us/docs/internal-apps/)

Then, try re-generating the app credentials and generating a new token with the new account id.

Please let me know if if you’re able to access the API after doing all of this.

---

<div class="post-metadata">

**Author:** ![eric.petersson](https://avatars.discourse-cdn.com/v4/letter/e/c4cdca/32.png) [@eric.petersson](https://devforum.zoom.us/u/eric.petersson)\
**Post date:** [October 12, 2023, 5:29am UTC](https://devforum.zoom.us/t/transfer-account-ownership-resulted-in-broken-rest-api-for-server-to-server-oauth/96609/5 "2023-10-12T05:29:04Z")

</div>

Hi Gianni

Yes, indeed it worked out when the new owner just reassigned his credentials.

Thansk for the support!

Regards  
Eric

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [October 12, 2023, 4:01pm UTC](https://devforum.zoom.us/t/transfer-account-ownership-resulted-in-broken-rest-api-for-server-to-server-oauth/96609/6 "2023-10-12T16:01:03Z")

</div>

Perfect! Happy to help!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [October 13, 2023, 4:01pm UTC](https://devforum.zoom.us/t/transfer-account-ownership-resulted-in-broken-rest-api-for-server-to-server-oauth/96609/7 "2023-10-13T16:01:16Z")

</div>

Closed on October 13, 2023, 4:01pm UTC

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