# Can't create a meeting in server-to sserver api (Java)

**URL:** <https://devforum.zoom.us/t/cant-create-a-meeting-in-server-to-sserver-api-java/109736>\
**Category:** API and Webhooks\
**Created:** [May 11, 2024, 5:45pm UTC](https://devforum.zoom.us/t/cant-create-a-meeting-in-server-to-sserver-api-java/109736 "2024-05-11T17:45:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![achili3f17](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/achili3f17/32/59566_2.png) [@achili3f17](https://devforum.zoom.us/u/achili3f17)\
**Post date:** [May 11, 2024, 5:45pm UTC](https://devforum.zoom.us/t/cant-create-a-meeting-in-server-to-sserver-api-java/109736/1 "2024-05-11T17:45:49Z")

</div>

Hi!  
I thought I had studied the information enough, but I encountered a 401 error.  
I want to create a link to a meeting in the application.  
I make a request to receive a token

> var response = restTemplate.postForEntity(  
> “[https://zoom.us/oauth/token](https://zoom.us/oauth/token)”,request,Map.class);

I receive token (I checked) and make request to create a meeting

> String accessToken = (String) \>Objects.requireNonNull(response.getBody()).get(“access\_token”);

> HttpHeaders headers = new HttpHeaders();  
> headers.set(“Authorization”, "Bearer " + accessToken);

> String requestBody = String.format(  
> “{"topic": "New Meeting", "start\_time": "%s", "duration": %d}”,  
> startTime, duration);

> HttpEntity request = new HttpEntity\<\>(requestBody, headers);

> ```
> var response = restTemplate.postForEntity(
> 
> ```

```
            "https://api.zoom.us/v2/users/me/meetings", request,Map.class);

```

but in the end I get a 401 error

---

<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, 2025, 9:22am UTC](https://devforum.zoom.us/t/cant-create-a-meeting-in-server-to-sserver-api-java/109736/2 "2025-05-15T09:22:42Z")

</div>

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