Xembedo Rest API Documentation

Get Access Token

Use access token returned in response of this method with every other api call you make, they will not get through without a valid value for this. token comes with expiry of 1 min, you will have to get the token again for any further delay.

{POST} http://www.xembedo.com/api/gettoken 

Request Parameters

Field Type Data Type Description
apikey body, header, query String Application's unique API key

Success Response

{ 
  "success": true,   
  "message": "Enjoy your token!",  
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjp7Il9pZCI6IjU2MGUxOTQyNDVkZTA1ODQ2NzZkYTViMCIsInJlZ2lzdHJhdGlvbmRhdGUiOiIyMDE1LTEwLTAyVDA1OjQyOjI2Ljg2OVoiLCJwaG9uZSI6Ijk4NzYwODIxMjMiLCJwYXNzd29yZCI6IiQyYSQwOCRURURTUHI1STZGZUFIUFlVUDNhd2l1RDgzUkQzdHRSTWtXUzViMm1PTFNEZDdTQTJFL2hrMiIsImVtYWlsIjoidW1lc2hzaGFybWFqaUBnbWFpbC5jb20iLCJuYW1lIjoiVW1lc2giLCJfX3YiOjB9LCJpYXQiOjE0NDQwNjMxNjUsImV4cCI6MTQ0NDA2MzIyNX0.T1jUPmyDp74fbGlgBllZ3zAM29MSDwu4X6k2aEN0qB4"
}
                            
                            

Error Response

{
  "success": false,  
  "message": "Authentication failed. app key not found."
}
                            

Upload Document

Use this method to upload a document to your account. At present we support pptx, ppt, docx, doc, xlsx, xls and pdf files. Maximum upload size allowed is as per your membership, free account by default allows uploads only upto 20 MB

{POST} http://www.xembedo.com/api/uploads 

Request Parameters

Field Type Data Type Description
token body, header, query String token returned by /gettoken method
myFile body File object in form's body
id body String Member Id of the user, whose upload list is to fetched

Success Response


{
  "success":true,
  "data":
    [
      {
        "_id":"561f5803df3537a0164f1584",
        "date":"2015-10-15T07:38:43.699Z",
        "status":"0",
        "mimetype":"application/pdf",
        "size":"731745",
        "name":"Your First Document"
      }
    ]
}
                            
                            

Error Response


{
  "success": false,  
  "message": "Error Message"
}
                            

Webhook/Callback for Conversion Status

Conversion Status of documents uploaded using above listed /upload method will be sent on this URL. You can configure this from your accounts page. We strongly recommend to use this to avoid polling our servers to get status of conversion.

Get Processing Queue

Use this method to get list of your documents waiting in queue for processing.

{GET} http://www.xembedo.com/api/uploads/pending 

Request Parameters

Field Type Date Type Description
token body, header, query String token returned by /gettoken method

Success Response


{
    "success": true,
    "pending": [
        {
            "_id": "56273ba13596ca9013351b6c",
            "date": "2015-10-21T07:15:45.302Z",
            "status": "0",
            "mimetype": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
            "size": "80148658",
            "name": "list-0"
        }
    ]
}
                            
                            

Error Response

{
  "success": false,  
  "message": "Authentication failed. app key not found."
}
                            

Get Status of a Document

Use this method to know the status of a document in your account, whether its processed, failed or still in queue

{POST} http://www.xembedo.com/api/uploads/status 

Request Parameters

Field Type Date Type Description
token body, header, query String token returned by /gettoken method
uploadid body String Upload Id of the document for which you want to know the status. You can get these by fetching uploads in your account by calling http://www.xembedo.com/api/uploads POST method listed above

Success Response


{
  "success": true,
  "status": pending
}
                            
                            

Error Response


{
  "success": false,  
  "message": "Error Message"
}
                            

Get Uploads

This methods returns list of uploads for a User. You will need to specify page number by setting the value of 'page' and number of elements to be returned in 'size' query string parameters.

{GET} http://www.xembedo.com/api/uploads 

Request Parameters

Field Type Date Type Description
token body, header, query String token returned by /gettoken method
page query Integer Page number of results to return
size query Integer Number of records to be returned.
id query String Member Id of the user, whose upload list is to fetched

Success Response


{
  "success":true,
  "totaldocuments":2
  "data":
    [
      {
        "_id":"561f5803df3537a0164f1584",
        "date":"2015-10-15T07:38:43.699Z",
        "status":"0",
        "mimetype":"application/pdf",
        "size":"731745",
        "name":"Your First Document"
      }, 
      {
        "_id": "56273ba13596ca9013351b6c",
        "date": "2015-10-21T07:15:45.302Z",
        "status": "0",
        "mimetype": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
        "size": "80148658",
        "name": "list-0"
      }
    ]
}

                            
                            

Error Response

{
  "success": false,  
  "message": "Error Message"
}
                            

Delete Document

Use this method to delete a document to your account. This will remove the source as well as the output on {x}embedo

{DELETE} http://www.xembedo.com/api/uploads/delete 

Request Parameters

Field Type Date Type Description
token body, header, query String token returned by /gettoken method
uploadid body String Upload Id of the document to delete. You can get these by fetching uploads in your account by calling http://www.xembedo.com/api/uploads POST method listed above

Success Response


{
  "success":true,
  "message":"Document Deleted"
}
                            
                            

Error Response

{
  "success": false,  
  "message": "Error Message"
}
                            

Get Embed for a Document

Use this method to get embed code for a document in your account.

{POST} http://www.xembedo.com/api/uploads/embed 

Request Parameters

Field Type Date Type Description
token body, header, query String token returned by /gettoken method
uploadid body String Upload Id of the document for which you want the embed code. You can get these by fetching uploads in your account by calling http://www.xembedo.com/api/uploads POST method listed above

Success Response


{
  "success":true,
  "embed":<iframe style="width: 600px; height:450px; border-radius: 1px; border: 1px solid #d9d9d9"; src= http://www.xembedo.com/uploads/iplayer/561f5803df3537a0164f1584></iframe>
}
                            
                            

Error Response


{
  "success": false,  
  "message": "Error Message"
}
                            

Edit Document Info

Use this method to edit information of a document in your account. Currently, you can change only the name of the document.

{PUT} http://www.xembedo.com/api/uploads/edit 

Request Parameters

Field Type Date Type Description
token body, header, query String token returned by /gettoken method
uploadid body String Upload Id of the document to edit. You can get these by fetching uploads in your account by calling http://www.xembedo.com/api/uploads POST method listed above
name body String New name for your document

Success Response


{
  "success":true,
  "name":"New name for my document"
}
                            
                            

Error Response


{
  "success": false,  
  "message": "Error Message"
}