0

Everybody. i am come with a problem that answer i could not found google. so i asked.

problem is when i try to calling Zoom any API then i am greeting error CROS that is below. i used proxy server for this but not working .so i removed this from anguler.json.

Access to XMLHttpRequest at 'https://api.zoom.us/v2/users/La------77/meetings' 
from origin 'http://localhost:4200' has been blocked by CORS policy: Response to preflight 
request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present 
on the requested resource.

i am setting 'Access-Control-Allow-Origin:*' but not working. i configure proxy server but it was being redirect on Zoom site.

check my code

fetchAllMeetings(){
    let header = new HttpHeaders({  "Authorization": "Bearer "+this.CLIENT_TOKEN,
        'Content-Type': 'application/json',
        'Access-Control-Allow-Origin': '*'   });

         const requestOptions = {  headers: header};

    return this.httpClient.get('https://api.zoom.us/v2/users/LayQ----FTgmw/meetings',requestOptions).pipe(first(), catchError(this.handleError));
}

Response Error

enter image description here

API Call

enter image description here

I setup proxy server for this... but removed because i was redirect in zoom website.

src/proxy.conf.json

{
  "*": {
    "target": "https://api.zoom.us",
    "secure": false,
    "logLevel": "debug"
  }
}

angular.json

"serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "Zoom-Meeting:build",
            "proxyConfig": "src/proxy.conf.json"

          },
pankaj
  • 1
  • 17
  • 36

1 Answers1

0

I believe you've misunderstood the CORS error response you got. CORS settings are made by the zoom api. Zoom does not allow an unknown domain (in your case localhost:4200) to access that uesrs/----/meetings endpoint. I'm afraid there is nothing you can do to make this work.

Benlier
  • 53
  • 3
  • ok, thanks. i used Laravel backend for solve this issue. where i an using CURL for call zoom api. so after working fine. – pankaj Feb 16 '21 at 09:47