Player Management API Sample: Delete Players

Product(s)
Video Cloud
Role(s)
API Developer
Task(s)
Create & Configure Players
Topic(s)
Code Samples
API(s)
Player Management API

In this example, you enter your account username, ID and password. On click of the button all the account's players are displayed with a checkbox for each one. After selecting one or more players to delete, click the Delete Players button to delete indicated players.

Disclaimer

You can get the functional, non-styled Delete Player code and place it on a local web server if you need a delete players app.

Default player

Although you can delete the default player, a new default player will automatically be recreated instantly. This is so there is always at least one player in each account, which provides an optimal UI experience.

App architecture

The high-level application logic for this app is as follows:

  1. Gather necessary data to access account
  2. On button click, perform AJAX call to retrieve all player info
  3. On AJAX call success perform the following:
    • Call function to display a checkbox, followed by player name, for all players
    • Call function that continuously watches checkboxes for checked status and keeps an array of IDs for all checked players
  4. On button click, start process to loop over selected player IDs and perform AJAX call to delete each player
  5. On AJAX call success perform the following:
    • Clear the existing list of players
    • Display the returned 204 status code that indicates successful deletion

Account input

Username:

Account ID:

Password:

Display Players

Your players will be displayed here.

Delete Players

Processed response

No response data is returned on a player delete, so the successful delete code of 204 is retrieved and displayed from the AJAX object for each deletion: