# Questions regarding ZAK & Meeting SDK call flow & errors

**URL:** <https://devforum.zoom.us/t/questions-regarding-zak-meeting-sdk-call-flow-errors/67482>\
**Category:** macOS\
**Created:** [April 13, 2022, 7:29am UTC](https://devforum.zoom.us/t/questions-regarding-zak-meeting-sdk-call-flow-errors/67482 "2022-04-13T07:29:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![blain](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@blain](https://devforum.zoom.us/u/blain)\
**Post date:** [April 13, 2022, 7:29am UTC](https://devforum.zoom.us/t/questions-regarding-zak-meeting-sdk-call-flow-errors/67482/1 "2022-04-13T07:29:14Z")

</div>

**Description**  
I’m fairly new to OAuth as well as Zoom dev. I’m trying to add a feature to an existing native desktop app that’ll allow users to launch zoom meetings. Thus far, I’m able to obtain an access token via OAuth and obtain a ZAK for user\_id=me. But I’m unable to launch a meeting because getMeetingService() returns nil. Additionally, isAuthorized() returns ‘3’ (failure). I’d really appreciate help figuring out why.

Following the sample code, after obtaining both an access token and a zak, I initialize the meeting sdk:

```auto
    ZoomSDKInitParams* params = [[ZoomSDKInitParams alloc] init];
    params.needCustomizedUI = NO;
    params.teamIdentifier = nil;
    
    [[ZoomSDK sharedSDK] initSDKWithParams:params];
    [[ZoomSDK sharedSDK] setZoomDomain:[NSString stringWithStdString:kDomain]];

    params = nil;

```

Then I attempt to access the meeting service:

```auto
        auto sharedSDK = [ZoomSDK sharedSDK];

        auto authService = [sharedSDK getAuthService]; //debug
       BOOL isAuth = [authService isAuthorized]; //debug
        
        auto meetingService = [sharedSDK getMeetingService];
        if (isAuth && meetingService)
        {
            ZoomSDKStartMeetingUseZakElements *params = [[ZoomSDKStartMeetingUseZakElements alloc] init];
            params.zak = _mZAK;
            params.userType = SDKUserType_APIUser;
            params.userId = @"me";
            params.displayName = @"Tester";
            params.meetingNumber = 0;
            params.isDirectShare = NO;
            params.displayID = 0;
            params.isNoVideo = NO;
            params.isNoAuido = NO;
            params.vanityID = nil;
            ZoomSDKError ret = [meetingService startMeetingWithZAK:params];
        }

```

Also, is the userType as well as all the param settings correct? (I’ve found any docs explaining user types very confusing)

Additionally, I’m very confused about the call flow, which I currently understand to be:

1. Use OAuth to obtain an access token and zak for the user
2. Init the SDK
3. Get an instance of the meeting service
4. Pass the zak to the meeting service to start a meeting on behalf of the user

Is this correct or am I missing steps? If this is correct, can you help me figure out why it doesn’t work for me?

And finally, even more confusing is the seemingly conflicting documentation:

According to the following page, I should be using JWT’s to authenticate the app:

> **[Authentication](https://marketplace.zoom.us/docs/sdk/native-sdks/auth/)**
>
> The Zoom Developer Platform is an open platform that allows third-party developers to build applications and integrations upon Zoom’s video-first unified communications platform.

But then this page displays a diagram which suggests all I have to do is what I’ve already done - authenticate the user via pkce /oauth, obtain a zak for the user, and I should be able to launch a meeting:

> **[Supporting OAuth in your SDK app](https://marketplace.zoom.us/docs/sdk/native-sdks/auth/support-oauth-SDK-app/)**
>
> The Zoom Developer Platform is an open platform that allows third-party developers to build applications and integrations upon Zoom’s video-first unified communications platform.

In fact, the client secret is encoded and appended to the access token request, which I understood meant I didn’t have to generate a JWT to send that info to zoom servers.

Also on that page([Supporting OAuth in your SDK app](https://marketplace.zoom.us/docs/sdk/native-sdks/auth/support-oauth-SDK-app/)), the directions on requesting an access token conflict with the instructions on this page:[Authentication](https://marketplace.zoom.us/docs/sdk/native-sdks/auth) and the api reference.

Can you please point me to the definitive and correct docs? The comments in the header files are useful for reference but are not at all instructive (and are sometimes also confusing) due to their brevity.

**Which macOS Meeting SDK version?**  
SDK Version: 5.9.6 (5014)  
MacOS version: 10.15.7

**Device (please complete the following information):**  
Macbook Pro

**Additional context**  
Because I searched this forum before posting:

- I did double check my project settings - all frameworks, dylibs, etc are being copied to the frameworks dir in the final product.
- I’m using domain ‘[zoom.us](http://zoom.us)’
- ZAK obtained via endpoint “[https://api.zoom.us/v2/users/me/zak](https://api.zoom.us/v2/users/me/zak)”

Thanks in advance for any help.

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [April 13, 2022, 11:09pm UTC](https://devforum.zoom.us/t/questions-regarding-zak-meeting-sdk-call-flow-errors/67482/2 "2022-04-13T23:09:07Z")

</div>

Hi @blain,

Based on the information you’ve provided, it doesn’t seem like you are authorizing the SDK with your SDK credentials. To do this, you can call [`sdkAuth`](https://marketplacefront.zoom.us/sdk/meeting/macos/interface_zoom_s_d_k_auth_service.html#a166c9e609dab3146e1d46e5d20b5b6e3) and then check the [`onZoomSDKAuthReturn`](https://marketplacefront.zoom.us/sdk/meeting/macos/protocol_zoom_s_d_k_auth_delegate-p.html#a0c79cfde1159d84f12a018c81fd6dd2e) callback to determine whether or not it was successful. This process is completely independent of the OAuth credentials you used to obtain an access token and ZAK, and cannot be done with OAuth credentials.

OAuth is used to authenticated the Zoom users joining meetings through your app, and SDK auth is used to verify your developer account. So if you are going to be joining or starting a meeting as an authenticated user through the SDK, both types of auth are required.

Thanks!

---

<div class="post-metadata">

**Author:** ![blain](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@blain](https://devforum.zoom.us/u/blain)\
**Post date:** [April 13, 2022, 11:41pm UTC](https://devforum.zoom.us/t/questions-regarding-zak-meeting-sdk-call-flow-errors/67482/3 "2022-04-13T23:41:20Z")

</div>

Hi Jon,

Thanks for the quick response 🙂

Just to be clear, I’d like users to be able to launch zoom meetings from the app, not just join. And also invite other users to their meeting. Does your answer still apply in this case?

Also, in order to check the onZoomSDKAuthReturn callback, the caller would have to conform to the ZoomSDKAuthDelegate protocol and set itself as the ZoomSDKAuthService delegate, correct?

Wouldn’t calling isAuthorized or checking the return value of sdkAuth achieve the same thing?

Thanks!

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [April 14, 2022, 5:28pm UTC](https://devforum.zoom.us/t/questions-regarding-zak-meeting-sdk-call-flow-errors/67482/4 "2022-04-14T17:28:21Z")

</div>

Hi @blain,

> Just to be clear, I’d like users to be able to launch zoom meetings from the app, not just join. And also invite other users to their meeting. Does your answer still apply in this case?

Yes, this applies to both starting and joining meetings.

> Also, in order to check the onZoomSDKAuthReturn callback, the caller would have to conform to the ZoomSDKAuthDelegate protocol and set itself as the ZoomSDKAuthService delegate, correct?

It seems that you have a correct understanding of what this flow looks like. 🙂

> Wouldn’t calling isAuthorized or checking the return value of sdkAuth achieve the same thing?

When you use your developer credentials via `sdkAuth`, it involves asynchronous operations since the SDK needs to talk with our back end to validate your credentials. So the return value of the `sdkAuth` method just indicates whether or not the SDK will start this process. The `onZoomSDKAuthReturn` callback is triggered when the SDK gets a response from our servers.

Thanks!

---

<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:** [May 15, 2022, 3:29am UTC](https://devforum.zoom.us/t/questions-regarding-zak-meeting-sdk-call-flow-errors/67482/5 "2022-05-15T03:29:12Z")

</div>

Closed on May 15, 2022, 3:29am UTC

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