# I made a Server-to-Server OAuth application to use a Webhook and API. How to create JWT for the API?

**URL:** <https://devforum.zoom.us/t/i-made-a-server-to-server-oauth-application-to-use-a-webhook-and-api-how-to-create-jwt-for-the-api/85643>\
**Category:** Meetings\
**Tags:** webhooks, api, jwt\
**Created:** [March 30, 2023, 1:11am UTC](https://devforum.zoom.us/t/i-made-a-server-to-server-oauth-application-to-use-a-webhook-and-api-how-to-create-jwt-for-the-api/85643 "2023-03-30T01:11:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![0417taehyun](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/0417taehyun/32/46759_2.png) [@0417taehyun](https://devforum.zoom.us/u/0417taehyun)\
**Post date:** [March 30, 2023, 1:11am UTC](https://devforum.zoom.us/t/i-made-a-server-to-server-oauth-application-to-use-a-webhook-and-api-how-to-create-jwt-for-the-api/85643/1 "2023-03-30T01:11:48Z")

</div>

I made a Server-to-Server OAuth application to use a Webhook and API. How to create JWT for the API?

I saw the notification that `This app type will be deprecated on 6/1/2023` on JWT app type. Thus, I want to use Zoom API with Webhook, and I choose the Server-to-Server OAuth app type.

However, I can use the `Client ID` and `Client secret` , but cannot use the JWT for the API. Are there anyways to use the `Client ID` and `Client secret` to create JWT, or should I use another type of apps?

---

<div class="post-metadata">

**Author:** ![ojus.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ojus.zoom/32/734_2.png) [@ojus.zoom](https://devforum.zoom.us/u/ojus.zoom)\
**Post date:** [March 30, 2023, 3:50am UTC](https://devforum.zoom.us/t/i-made-a-server-to-server-oauth-application-to-use-a-webhook-and-api-how-to-create-jwt-for-the-api/85643/2 "2023-03-30T03:50:19Z")

</div>

Actually, JWT app type will be deprecated.

To generate a token using s2s app, make a post request to the Zoom OAuth Endpoint.

Here is how to make the request to the OAuth endpoint:

curl --location --request POST ‘[https://zoom.us/oauth/token?grant\_type=account\_credentials&account\_id=](https://zoom.us/oauth/token?grant_type=account_credentials&account_id=)’   
–header ‘Authorization: Basic (Base64 encode clientID:clientsecret)’ \

---

<div class="post-metadata">

**Author:** ![shopeasy9870](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@shopeasy9870](https://devforum.zoom.us/u/shopeasy9870)\
**Post date:** [July 20, 2023, 10:48am UTC](https://devforum.zoom.us/t/i-made-a-server-to-server-oauth-application-to-use-a-webhook-and-api-how-to-create-jwt-for-the-api/85643/3 "2023-07-20T10:48:37Z")

</div>

And how to modify the code for join in zoom using s2s OAuth app type , I got client id and client secret as app credentials and how to execute this  
below code is used for jwt , from this how to modify for server-to-server oauth

 \<?php echo get\_phrase('live\_class'); ?\> : \<?php echo $course\_details['title']; ?\> 

```
<script src="https://source.zoom.us/2.6.0/lib/vendor/react.min.js"></script>
<script src="https://source.zoom.us/2.6.0/lib/vendor/react-dom.min.js"></script>
<script src="https://source.zoom.us/2.6.0/lib/vendor/redux.min.js"></script>
<script src="https://source.zoom.us/2.6.0/lib/vendor/redux-thunk.min.js"></script>
<script src="<?php echo base_url('assets/backend/js/jquery-3.3.1.min.js'); ?>"></script>
<script src="https://source.zoom.us/2.6.0/lib/vendor/lodash.min.js"></script>
<script src="https://source.zoom.us/zoom-meeting-2.6.0.min.js"></script>

<script>

$(window).on("orientationchange",function(){
    console.log("Orientation changed");
});
function stop_zoom() {
    var r = confirm("<?php echo get_phrase('do_you_want_to_leave_the_live_video_class'); ?> ? <?php echo get_phrase('you_can_join_them_later_if_the_video_class_remains_ive'); ?>");
    if (r == true) {
        ZoomMtg.leaveMeeting();
    }

}

$(document).ready(function() {
    start_zoom();
});

function start_zoom() {

    ZoomMtg.preLoadWasm();
    ZoomMtg.prepareJssdk();

    var API_KEY = "<?php echo get_settings('zoom_api_key'); ?>";
    var API_SECRET = "<?php echo get_settings('zoom_secret_key'); ?>";
    var USER_NAME = "<?php echo $logged_user_details['first_name'] . " " . $logged_user_details['last_name']; ?>";
    var MEETING_NUMBER = "<?php echo $live_class_details['zoom_meeting_id']; ?>";
    var PASSWORD = "<?php echo $live_class_details['zoom_meeting_password']; ?>";

    testTool = window.testTool;

    var meetConfig = {
        apiKey: API_KEY,
        apiSecret: API_SECRET,
        meetingNumber: MEETING_NUMBER,
        userName: USER_NAME,
        passWord: PASSWORD,
        leaveUrl: "<?php echo site_url('home/live_class_mobile_web_view/' . slugify($course_details['id']) . '/' . $logged_user_details['id']); ?>/true",
        role: 0
    };

    var signature = ZoomMtg.generateSignature({
        meetingNumber: meetConfig.meetingNumber,
        apiKey: meetConfig.apiKey,
        apiSecret: meetConfig.apiSecret,
        role: meetConfig.role,
        success: function(res) {
            console.log(res.result);
        }
    });

    ZoomMtg.init({
        leaveUrl: "<?php echo site_url('home/live_class_mobile_web_view/' . slugify($course_details['id']) . '/' . $logged_user_details['id']); ?>/true",
        meetingInfo: ['topic', 'host'],
        isSupportAV: true,
        success: function() {
            ZoomMtg.join({
                meetingNumber: meetConfig.meetingNumber,
                userName: meetConfig.userName,
                signature: signature,
                apiKey: meetConfig.apiKey,
                passWord: meetConfig.passWord,
                success: function(res) {
                    console.log('join meeting success');
                },
                error: function(res) {
                    console.log(res);
                }
            });
        },
        error: function(res) {
            console.log(res);
        }
    });
}
</script>

```

---

<div class="post-metadata">

**Author:** ![ojus.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ojus.zoom/32/734_2.png) [@ojus.zoom](https://devforum.zoom.us/u/ojus.zoom)\
**Post date:** [July 27, 2023, 9:22pm UTC](https://devforum.zoom.us/t/i-made-a-server-to-server-oauth-application-to-use-a-webhook-and-api-how-to-create-jwt-for-the-api/85643/4 "2023-07-27T21:22:24Z")

</div>

Please follow the guidelines here: [JWT app type migration guide](https://developers.zoom.us/docs/internal-apps/jwt-app-migration/)
