Class VideosDelegatedUploadApi

java.lang.Object
video.api.client.api.clients.VideosDelegatedUploadApi

public class VideosDelegatedUploadApi
extends java.lang.Object
  • Constructor Details

    • VideosDelegatedUploadApi

      public VideosDelegatedUploadApi​(ApiClient apiClient)
  • Method Details

    • getApiClient

      public ApiClient getApiClient()
    • setApiClient

      public void setApiClient​(ApiClient apiClient)
    • deleteToken

      public void deleteToken​(java.lang.String uploadToken) throws ApiException
      Delete an upload token Delete an existing upload token. This is especially useful for tokens you may have created that do not expire.
      Parameters:
      uploadToken - The unique identifier for the upload token you want to delete. Deleting a token will make it so the token can no longer be used for authentication. (required)
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      Http Response Details:
      Status Code Description Response Headers
      204 No Content -
      404 Not Found -
    • deleteTokenWithHttpInfo

      public ApiResponse<java.lang.Void> deleteTokenWithHttpInfo​(java.lang.String uploadToken) throws ApiException
      Delete an upload token Delete an existing upload token. This is especially useful for tokens you may have created that do not expire.
      Parameters:
      uploadToken - The unique identifier for the upload token you want to delete. Deleting a token will make it so the token can no longer be used for authentication. (required)
      Returns:
      ApiResponse<Void>
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      Http Response Details:
      Status Code Description Response Headers
      204 No Content -
      404 Not Found -
    • listTokens

      List all active upload tokens. A delegated token is used to allow secure uploads without exposing your API key. Use this endpoint to retrieve a list of all currently active delegated tokens.
      Returns:
      APIlistTokensRequest
      Http Response Details:
      Status Code Description Response Headers
      200 Success -
    • getToken

      public UploadToken getToken​(java.lang.String uploadToken) throws ApiException
      Show upload token You can retrieve details about a specific upload token if you have the unique identifier for the upload token. Add it in the path of the endpoint. Details include time-to-live (ttl), when the token was created, and when it will expire.
      Parameters:
      uploadToken - The unique identifier for the token you want information about. (required)
      Returns:
      UploadToken
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      Http Response Details:
      Status Code Description Response Headers
      200 Success -
      404 Not Found -
    • getTokenWithHttpInfo

      public ApiResponse<UploadToken> getTokenWithHttpInfo​(java.lang.String uploadToken) throws ApiException
      Show upload token You can retrieve details about a specific upload token if you have the unique identifier for the upload token. Add it in the path of the endpoint. Details include time-to-live (ttl), when the token was created, and when it will expire.
      Parameters:
      uploadToken - The unique identifier for the token you want information about. (required)
      Returns:
      ApiResponse<UploadToken>
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      Http Response Details:
      Status Code Description Response Headers
      200 Success -
      404 Not Found -
    • upload

      public Video upload​(java.lang.String token, java.io.File file) throws ApiException
      Upload with an upload token When given a token, anyone can upload a file to the URI `https://ws.api.video/upload?token=<tokenId>`. Example with cURL: ```curl $ curl --request POST --url 'https://ws.api.video/upload?token=toXXX' --header 'content-type: multipart/form-data' -F file=@video.mp4 ``` Or in an HTML form, with a little JavaScript to convert the form into JSON: ```html <!--form for user interaction--> <form name=\"videoUploadForm\" > <label for=video>Video:</label> <input type=file name=source/><br/> <input value=\"Submit\" type=\"submit\"> </form> <div></div> <!--JS takes the form data uses FormData to turn the response into JSON. then uses POST to upload the video file. Update the token parameter in the url to your upload token. --> <script> var form = document.forms.namedItem(\"videoUploadForm\"); form.addEventListener('submit', function(ev) { ev.preventDefault(); var oOutput = document.querySelector(\"div\"), oData = new FormData(form); var oReq = new XMLHttpRequest(); oReq.open(\"POST\", \"https://ws.api.video/upload?token=toXXX\", true); oReq.send(oData); oReq.onload = function(oEvent) { if (oReq.status ==201) { oOutput.innerHTML = \"Your video is uploaded!<br/>\" + oReq.response; } else { oOutput.innerHTML = \"Error \" + oReq.status + \" occurred when trying to upload your file.<br />\"; } }; }, false); </script> ``` ### Dealing with large files We have created a <a href='https://api.video/blog/tutorials/uploading-large-files-with-javascript'>tutorial</a> to walk through the steps required.
      Parameters:
      token - The unique identifier for the token you want to use to upload a video. (required)
      file - The path to the video you want to upload. (required)
      Returns:
      Video
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      Http Response Details:
      Status Code Description Response Headers
      201 Created -
      400 Bad Request -
    • upload

      public Video upload​(java.lang.String token, java.io.File file, UploadProgressListener uploadProgressListener) throws ApiException
      Upload with an upload token When given a token, anyone can upload a file to the URI `https://ws.api.video/upload?token=<tokenId>`. Example with cURL: ```curl $ curl --request POST --url 'https://ws.api.video/upload?token=toXXX' --header 'content-type: multipart/form-data' -F file=@video.mp4 ``` Or in an HTML form, with a little JavaScript to convert the form into JSON: ```html <!--form for user interaction--> <form name=\"videoUploadForm\" > <label for=video>Video:</label> <input type=file name=source/><br/> <input value=\"Submit\" type=\"submit\"> </form> <div></div> <!--JS takes the form data uses FormData to turn the response into JSON. then uses POST to upload the video file. Update the token parameter in the url to your upload token. --> <script> var form = document.forms.namedItem(\"videoUploadForm\"); form.addEventListener('submit', function(ev) { ev.preventDefault(); var oOutput = document.querySelector(\"div\"), oData = new FormData(form); var oReq = new XMLHttpRequest(); oReq.open(\"POST\", \"https://ws.api.video/upload?token=toXXX\", true); oReq.send(oData); oReq.onload = function(oEvent) { if (oReq.status ==201) { oOutput.innerHTML = \"Your video is uploaded!<br/>\" + oReq.response; } else { oOutput.innerHTML = \"Error \" + oReq.status + \" occurred when trying to upload your file.<br />\"; } }; }, false); </script> ``` ### Dealing with large files We have created a <a href='https://api.video/blog/tutorials/uploading-large-files-with-javascript'>tutorial</a> to walk through the steps required.
      Parameters:
      token - The unique identifier for the token you want to use to upload a video. (required)
      file - The path to the video you want to upload. (required)
      uploadProgressListener - An upload progress listener
      Returns:
      Video
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      Http Response Details:
      Status Code Description Response Headers
      201 Created -
      400 Bad Request -
    • uploadWithHttpInfo

      public ApiResponse<Video> uploadWithHttpInfo​(java.lang.String token, java.io.File file) throws ApiException
      Upload with an upload token When given a token, anyone can upload a file to the URI `https://ws.api.video/upload?token=<tokenId>`. Example with cURL: ```curl $ curl --request POST --url 'https://ws.api.video/upload?token=toXXX' --header 'content-type: multipart/form-data' -F file=@video.mp4 ``` Or in an HTML form, with a little JavaScript to convert the form into JSON: ```html <!--form for user interaction--> <form name=\"videoUploadForm\" > <label for=video>Video:</label> <input type=file name=source/><br/> <input value=\"Submit\" type=\"submit\"> </form> <div></div> <!--JS takes the form data uses FormData to turn the response into JSON. then uses POST to upload the video file. Update the token parameter in the url to your upload token. --> <script> var form = document.forms.namedItem(\"videoUploadForm\"); form.addEventListener('submit', function(ev) { ev.preventDefault(); var oOutput = document.querySelector(\"div\"), oData = new FormData(form); var oReq = new XMLHttpRequest(); oReq.open(\"POST\", \"https://ws.api.video/upload?token=toXXX\", true); oReq.send(oData); oReq.onload = function(oEvent) { if (oReq.status ==201) { oOutput.innerHTML = \"Your video is uploaded!<br/>\" + oReq.response; } else { oOutput.innerHTML = \"Error \" + oReq.status + \" occurred when trying to upload your file.<br />\"; } }; }, false); </script> ``` ### Dealing with large files We have created a <a href='https://api.video/blog/tutorials/uploading-large-files-with-javascript'>tutorial</a> to walk through the steps required.
      Parameters:
      token - The unique identifier for the token you want to use to upload a video. (required)
      file - The path to the video you want to upload. (required)
      Returns:
      ApiResponse<Video>
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      Http Response Details:
      Status Code Description Response Headers
      201 Created -
      400 Bad Request -
    • uploadWithHttpInfo

      public ApiResponse<Video> uploadWithHttpInfo​(java.lang.String token, java.io.File file, UploadProgressListener uploadProgressListener) throws ApiException
      Upload with an upload token When given a token, anyone can upload a file to the URI `https://ws.api.video/upload?token=<tokenId>`. Example with cURL: ```curl $ curl --request POST --url 'https://ws.api.video/upload?token=toXXX' --header 'content-type: multipart/form-data' -F file=@video.mp4 ``` Or in an HTML form, with a little JavaScript to convert the form into JSON: ```html <!--form for user interaction--> <form name=\"videoUploadForm\" > <label for=video>Video:</label> <input type=file name=source/><br/> <input value=\"Submit\" type=\"submit\"> </form> <div></div> <!--JS takes the form data uses FormData to turn the response into JSON. then uses POST to upload the video file. Update the token parameter in the url to your upload token. --> <script> var form = document.forms.namedItem(\"videoUploadForm\"); form.addEventListener('submit', function(ev) { ev.preventDefault(); var oOutput = document.querySelector(\"div\"), oData = new FormData(form); var oReq = new XMLHttpRequest(); oReq.open(\"POST\", \"https://ws.api.video/upload?token=toXXX\", true); oReq.send(oData); oReq.onload = function(oEvent) { if (oReq.status ==201) { oOutput.innerHTML = \"Your video is uploaded!<br/>\" + oReq.response; } else { oOutput.innerHTML = \"Error \" + oReq.status + \" occurred when trying to upload your file.<br />\"; } }; }, false); </script> ``` ### Dealing with large files We have created a <a href='https://api.video/blog/tutorials/uploading-large-files-with-javascript'>tutorial</a> to walk through the steps required.
      Parameters:
      token - The unique identifier for the token you want to use to upload a video. (required)
      file - The path to the video you want to upload. (required)
      uploadProgressListener - An upload progress listener
      Returns:
      ApiResponse<Video>
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      Http Response Details:
      Status Code Description Response Headers
      201 Created -
      400 Bad Request -
    • createToken

      public UploadToken createToken​(TokenCreatePayload tokenCreatePayload) throws ApiException
      Generate an upload token Use this endpoint to generate an upload token. You can use this token to authenticate video uploads while keeping your API key safe.
      Parameters:
      tokenCreatePayload - (optional)
      Returns:
      UploadToken
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      Http Response Details:
      Status Code Description Response Headers
      200 Success -
      400 Bad Request -
    • createTokenWithHttpInfo

      public ApiResponse<UploadToken> createTokenWithHttpInfo​(TokenCreatePayload tokenCreatePayload) throws ApiException
      Generate an upload token Use this endpoint to generate an upload token. You can use this token to authenticate video uploads while keeping your API key safe.
      Parameters:
      tokenCreatePayload - (optional)
      Returns:
      ApiResponse<UploadToken>
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      Http Response Details:
      Status Code Description Response Headers
      200 Success -
      400 Bad Request -