Webmeeting API - cors error when calling from external host

Status
Not open for further replies.

Kris G.

Silver Partner
Basic Certified
Joined
Jul 26, 2019
Messages
32
Reaction score
8
Note, I have added the following to the nginx configuration for testing purposes in an attempt to correct the situation, this worked in v18 but doesn't seem to in v20.

I have tried the previously working snippet in the following two sections of :

1. location ~ ^/webclient(?!(/api|3cx-worker.js))
2.See screenshot

if ($request_method = 'OPTIONS') { add_header 'Access-Control-Max-Age' 1728000; add_header 'Access-Control-Allow-Origin' 'testing.domain.org'; add_header 'Content-Type' application/json; add_header 'Content-Length' 1; add_header 'Access-Control-Allow-Headers' '3CX-ApiKey, content-type'; add_header 'Access-Control-Allow-Methods' 'OPTIONS'; return 200; }

I'll note I am able to create a meeting using Postman, this is of course because postman doesn't send a preflight request as it's a testing tool. As per web standards it's mandatory to have a preflight request approved by the API server. There does not seem to be anything within 3CX that would allow this, any insight would be appreciated.

Important note: for the purposes of my testing, an FQDN is not presently specified but is during production for obvious reasons.
 

Attachments

  • Screenshot 2024-02-24 215636.png
    Screenshot 2024-02-24 215636.png
    80.3 KB · Views: 6
Last edited:
Hi @Kris G. , maybe I haven't understood your problem, but WebMeeting API is meant to be used server side and not by a browser. In the server side scenario, you don't need any OPTIONS request. Also, your really don't want to expose your WebMeeting API key client side.

Can you describe the scenario? Who is sending API requests? Which language you use?
 
  • Like
Reactions: Evolute IT
I have a webform that is behind a customer portal login to allow them to book meetings using their existing 3CX instance rather than logging in to their 3CX webclient/app, so they can do everything in a single interface.

The webform is written in JS, it was working as of v18, I'm just trying to get it to work in v20.
 
JS running on the browser client side or NodeJS running on a server?
 
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
111,973
Messages
590,075
Members
164,895
Latest member
jasonkkrause