FAQ -> Integrations -> How to use LiveWebinar API?

How to use LiveWebinar API?

LiveWebinar API allows you to perform all the operations that are possible with your web client in the account panel or within your account mobile app. 

AUTHORIZATION FLOW

1. In order to use the following authorization flow (OAuth2 Authorization flow) you will need to register your app in our API to get your App Client ID, Client Secret and Redirect URL.

Head to https://app.livewebinar.com/api-apps to create APP credentials.

Use OAuth2 authorization for web application integration or use JWT for Server-to-Server integration.

More details at https://docs.archiebot.com

REQUEST 

curl --location --request POST
'https://api.archiebot.com/api/oauth/clients' \
--header 'Accept: application/vnd.archiebot.v1+json' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'name=WishList WP Plugin' \
--data-urlencode 'redirect=https://mywordpress-site.com/wpadmin/wishlist/livewebinar' 

RESPONSE

Status: 201 Created
Body:
{
 "name": "WishList WP Plugin",
 "client_id": 20406,
 "client_secret": "7piU9ZbHPFBoDIfigWuSlU79ZY7jQMDeHGlPCR38",
 "redirect_uri": "https://mywordpress-site.com/wpadmin/wishlist/livewebinar"
}

POSSIBLE RESPONSE CODES

500 Internal Server Error
500 3rd party client already exists.

2. Navigate user to the authorization page (open a popup or redirect them to this page):

https://app.livewebinar.com/auth/login

https://app.livewebinar.com/auth/oauth2/authorize?client_id=33385&redirect_uri=https%3A%2F%2Fyourwebsite.com%2F&response_type=code&state=123abc

Parameters required:

client_id = your ID
redirect_uri = an HTTPS URL where we have to redirect user when 
authorized
response_type = as you will be replacing the code, you will get with user’s 
API access token
state = optional

To set-up this integration on our end, we need to get the redirect URL on your side so we know where to redirect the user back when the integration is authorized on our end.

2. Once the user confirms the authorization, we will redirect them back to the redirect url URL with parameters: code and state (with your value if passed). Param code is your API
authorization code for this user.
3. Exchange authorization code to access_token and refresh_token (real authorization).

POST

https://api.archiebot.com/api/oauth/access_token

with header:

application/vnd.archiebot.v1+json with parameters:

with parameters:

grant_type: authorization_code 
client_id: 33385
client_secret: n3Bq4QFCe6sZgT6hkEbS8UC5YVuve2mfl7PGB4fR
code:  abc123 (this is the code you got with step 2 above)
redirect_uri:  the same redirect URI as passed when getting the code we 
also need it to finish setting you up. i.e: 
https://yourwebsite.com/auth/done

You will get user’s access_token and refresh_token for the API. Store it on your side and use it for further API requests for this user.

expires_id determines the expiration of access_token.

When expired or request unauthorised use refresh_token.

To get new tokens please go to:

POST

https://api.archiebot.com/api/oauth/access_token/refresh 

Docs: Link
Required API header: Link
Authorize by authorization code: Link

4. From now on you have on your side access_token and refresh_token for this user to LiveWebinar API.

Test endpoint:

GET

https://api.archiebot.com/api/me

Docs: Link

YourWebsite API OAuth Credentials:

client_id: xxxxxxxxxxxxxxxx
client_secret: xxxxxxxxxxxxxxx
grant_type: authorization_code

REQUESTS

1. Update your account settings (user_id parameters you get from the test endpoint)

GET

https://api.archiebot.com/api/me

Docs: Link

Update account details: 

PUT

https://api.archiebot.com/api/users/:user_id

Docs: Link

Let us know if you want to send specific details and we’ll respond with the actual API query.
Important: we don’t allow turning off email notifications over to API yet.
This has to be  done in the user account panel (you have to go to the “Advanced” tab when you schedule the meeting).

Please let us know in case you want us to add this (this will simplify the process).

2. Create Webinar/Meeting Room (in our API we call them widgets):

Docs: Link
Sample: Link

POST

https://api.archiebot.com/api/widgets

with params:

Such a request will create a webinar room (in API called ‘widget’) which will not ask participants for anything besides nickname on entrance. If you want to display a web form and gather some information you want to pass the form parameter with the webinar creation request.

Docs:  Link
  Link2

Important: we also provide JavaScript code to embed webinar/meeting rooms on your website. You can navigate panellists and your users to your URL i.e. 
https://yourwebsite.com/room/123-123-123 (or anything you like) instead of https://livewebinar.com/123-123-123

Simply create a blank HTML page, put the code in it and fill in the options:

_license_key - required, it is a widget->token you get after creating webinar room. i.e.: 123-123-123
• Optionally if you want to differentiate participants by role, you can add option _role_token which should have a string value of role hash (part of widget objects you get after creating webinar/widget). This way, if you know you’re displaying a page for your user, you can set him up automatically with a hosting role.

Note: for host we issue a URL to the meeting that holds that role automatically so in the calendar he has i.e. https://yourwebsite.com/room/123-123-
123/abcxyz123
 where abcxyz123 is the role hash for host role. Then just check
if you got this in the URI and pass that as _role_token. 

• Optional _nickname - if you know the name of this participant (i.e. from logged session)

3. Add panelist to webinar

Basically you don’t need to do that as from the above query (webinar creation). As you know, you can pass the role token hash to the URL (or to JavaScript Embed code) and the system will 
recognize this participant as a host or presenter. Below you will the option to generate direct room URLs that will also hold participant details like name, email etc.

• Option 1 (without web form before webinar):

Docs: Link

POST

https://api.archiebot.com/api/widgets/:widget_id/personal

with params:

emails required, a valid email of the participant
role optional, default attendee role assigned values: attendee, presenter, moderator 
firstname optional
lastname optional

As a result, you will get an object where the most important are attributes personal_token and/or personal_url.

Important: if you embed rooms on your website using the attached JavaScript code, add option _personal_token with a value of attribute personal_token from this request.
This way the system will use email and other data from this personal URL.

• Option 2:

with the web form on entry attached to the webinar during widget creation. This is the same request as for Option 1 but you also need to pass also data for the fields in that form (at least for 
required fields).

4. Delete webinar

Docs: Link

DELETE

https://api.archiebot.com/api/widgets/:widget_id

You can also enable/disable the room instead of deleting it):

Enable: Link
Disable: Link

5. Update webinar

It’s very similar to creating webinar but PUT requests.

Doc: Link

ROOM URL HACKS that you may consider.

The same can be done with JavaScript Embed code attached:

Direct URL for 
attendees
https://app.livewebinar.com/123-123-123
Direct presenter 
role room URL -

https://app.livewebinar.com/123-123-123/x/IYuUtn2P -> role token 
from widget resource on API.

Passing nickname https://app.livewebinar.com/123-123-123?_nickname=John%20Doe
Passing avatar 
image hosted by 
you 
https://app.livewebinar.com/123-123-123?avatar_url=https://yourwebsite.com/img/jonh.png

You can find the full API documentation here.