# ZoomApi \[{" code ": 200," message ":" Invalid api key or secret. "}\]"

**URL:** <https://devforum.zoom.us/t/zoomapi-code-200-message-invalid-api-key-or-secret/46976>\
**Category:** API and Webhooks\
**Created:** [March 31, 2021, 5:27am UTC](https://devforum.zoom.us/t/zoomapi-code-200-message-invalid-api-key-or-secret/46976 "2021-03-31T05:27:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cykaa1993](https://avatars.discourse-cdn.com/v4/letter/c/e19adc/32.png) [@cykaa1993](https://devforum.zoom.us/u/cykaa1993)\
**Post date:** [March 31, 2021, 5:27am UTC](https://devforum.zoom.us/t/zoomapi-code-200-message-invalid-api-key-or-secret/46976/1 "2021-03-31T05:27:21Z")

</div>

Hi, I received a token and when I send it to get the necessary data, it constantly throws the error “400: [{” code “: 200,” message “:” Invalid api key or secret. “}]”, Can you tell me how to solve this problem?

I am writing in Java, here is the code.

@SpringBootApplication  
public class ZoomBotApplication {  
private static final String PATH = “[https://api.zoom.us/oauth/token?grant\_type=client\_credentials](https://api.zoom.us/oauth/token?grant_type=client_credentials)”;  
private static final String clientID = “KWpd1nqwRdmQwEmBPDoubA”;  
private static final String clientSecret = “RISQWhwSj03pS6d6imyk4gKl5TYXPZLH”;

```
public static void main(String[] args) throws Exception {
    SpringApplication.run(ZoomBotApplication.class, args);
    RestTemplate template = new RestTemplate();
    HttpHeaders headers = new HttpHeaders();
    String token = clientID + ":" + clientSecret;
    String encodedString = Base64.getEncoder().encodeToString(token.getBytes());
    headers.setContentType(MediaType.APPLICATION_JSON);
    headers.add("Authorization", "Basic " + encodedString);
    HttpEntity<String> entity = new HttpEntity<>(headers);
    ResponseEntity<String> exchange = template.exchange(PATH, HttpMethod.POST, entity, String.class);
    System.out.println(exchange.getBody());

    HttpHeaders headers2 = new HttpHeaders();
    headers2.add("Authorization", "Bearer eyJhbGciOiJIUzUxMiIsInYiOiIyLjAiLCJraWQiOiIyY2E3YjE4YS02ZWFjLTQxYzktOWRlNS05ODU0MmY1NjdmMDEifQ.eyJhdWQiOiJodHRwczovL29hdXRoLnpvb20udXMiLCJ1aWQiOiJQWjBkWllERlRQYTV4NlhNVmhkV25nIiwidmVyIjo3LCJhdWlkIjoiMTIxZTk4Y2I2MjViMWZmMTJkMjVlOGQ4MDQwOTk0MDAiLCJuYmYiOjE2MTcxMTE5ODYsImlzcyI6InptOmNpZDpLV3BkMW5xd1JkbVF3RW1CUERvdWJBIiwiZ25vIjowLCJleHAiOjE2MTcxMTU1ODYsInR5cGUiOjIsImlhdCI6MTYxNzExMTk4NiwianRpIjoiZDQ4ZDM5MDctZDg1ZC00YjQxLTlhYWUtNmE5NGY4ZWQ1MWYwIn0.Md02lkAGtDgssBYu18fWH-lCBrHF_EPDIKsG2Un-rJMjMNVK3RPphCa0XP40PGDlxtSxblRXKAqm_DVsmOPdZA");
    HttpEntity<String> entity2 = new HttpEntity<>(headers2);
    ResponseEntity<String> exchange2 = template.exchange("https://api.zoom.us/v2/users/me", HttpMethod.GET, entity2, String.class);
    System.out.println(exchange2.getBody());
}

```

}

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [March 31, 2021, 5:19pm UTC](https://devforum.zoom.us/t/zoomapi-code-200-message-invalid-api-key-or-secret/46976/2 "2021-03-31T17:19:19Z")

</div>

Hey @cykaa1993,

Which kind of App are you generating your credentials from? Unless it’s a Chatbot, your grant\_type should be `authorization_code`. The `client_credentials` grant type is unique to Chatbots only.

Please make this adjustment and let us know if you still get this error. 🙂

Thanks,  
Will

---

<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 1, 2021, 3:19am UTC](https://devforum.zoom.us/t/zoomapi-code-200-message-invalid-api-key-or-secret/46976/3 "2021-05-01T03:19:28Z")

</div>

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