# Immediately Request Local Recording On Join

**URL:** <https://devforum.zoom.us/t/immediately-request-local-recording-on-join/88578>\
**Category:** Windows\
**Tags:** recording\
**Created:** [May 17, 2023, 4:39pm UTC](https://devforum.zoom.us/t/immediately-request-local-recording-on-join/88578 "2023-05-17T16:39:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tyler](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@tyler](https://devforum.zoom.us/u/tyler)\
**Post date:** [May 17, 2023, 4:39pm UTC](https://devforum.zoom.us/t/immediately-request-local-recording-on-join/88578/1 "2023-05-17T16:39:50Z")

</div>

**Description**  
I’m trying to build a Zoom bot that joins a meeting after being invited and then immediately requests rights to local recording (the bot it not OAuth’d and is not a meeting owner).

Currently, I have this code:

```auto
			if (m_sdk_login_ui_mgr->attemptJoin(envMeetingId, envMeetingPass, envBotName)) {
				auto requestRecordingResult = SDKInterfaceWrap::GetInst().GetMeetingService()->GetMeetingRecordingController()->RequestLocalRecordingPrivilege();
				if (requestRecordingResult != ZOOMSDK::SDKERR_SUCCESS) {
					std::cout << "Error requesting recording rights: " << requestRecordingResult << std::endl;
				}
			}

```

However, when I run this I get the error code `SDKERR_WRONG_USAGE`. What am I doing wrong?

**Which Windows Meeting SDK version?**  
v5.14.5.15340

**Device (please complete the following information):**  
Windows 11

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [May 18, 2023, 4:24am UTC](https://devforum.zoom.us/t/immediately-request-local-recording-on-join/88578/2 "2023-05-18T04:24:47Z")

</div>

If you are trying to record, there are a couple of things to take note of.

1. Make sure you already have permission to do so. This means the user is host / co-host or is given recording permission. You might be getting an error here, as you are trying to join the meeting, but have not successfully joined yet, hence you are unable to “ask for recording permission”

2. Call the startRecording method when you are “in meeting”. If you try to call startRecording while trying to join, it will not work.

Typically I would call startRecording from the meeting status callback. This is guarantee my status is “in meeting” before calling startRecording.

---

<div class="post-metadata">

**Author:** ![tyler](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@tyler](https://devforum.zoom.us/u/tyler)\
**Post date:** [May 18, 2023, 1:57pm UTC](https://devforum.zoom.us/t/immediately-request-local-recording-on-join/88578/3 "2023-05-18T13:57:42Z")

</div>

@chunsiong.zoom That worked. For further context for anyone having the same issue, the solution was to add this code in the `sdk_demo_app.cpp` file in the `CSDKDemoApp::onShowLoggedInUI` function are the end:

```auto
	auto requestRecordingResult = SDKInterfaceWrap::GetInst().GetMeetingService()->GetMeetingRecordingController()->RequestLocalRecordingPrivilege();
	if (requestRecordingResult != ZOOMSDK::SDKERR_SUCCESS) {
		std::cout << "Error requesting recording rights: " << requestRecordingResult << std::endl;
	}

```

When you do this, the bot will request the local recording rights as soon as it joins

---

<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:** [June 17, 2023, 11:57pm UTC](https://devforum.zoom.us/t/immediately-request-local-recording-on-join/88578/4 "2023-06-17T23:57:59Z")

</div>

Closed on June 17, 2023, 11:57pm UTC

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