Today we're going to learn how to use the Axeda Platform SDK v2 APIs to upload a file to the platform and create a software package.  This document is a work in progress, but we're going to show you everything you need to get started.  In my case I am using the very useful and easy to use Postman REST Client app available from the Chrome Store.  I'll be using some terms below (API Object Names) that can be found in the documents listed in the bibliography at the end of this article.


Assumptions (Replace these with your own versions):

  • username:  joe, password: password1!
  • platform instance:


First things first, we need to authenticate to the platform and get a session id (header x_axeda_wss_sessionid).


(Note: Postman does not automatically URL encode query parameters - this can be especially important for the password)



You'll receive a response like this following:

<ns1:WSSessionInfo xmlns:ns1="" xmlns:xsi="" xsi:type="ns1:WSSessionInfo">
    <ns1:created>2015-06-02T15:16:49 +0000</ns1:created>


Excellent, now we have a session id!


For the rest of the API calls (unless otherwise indicated), all of the following headers are set to the following:

  • x_axeda_wss_sessionid: 1a5XXXXX-d9aa-47f2-ac4f-28765ce5dbc5
  • Content-Type: application/xml
  • Accept: application/xml

The next step is to get our ModelReference:



<?xml version="1.0" encoding="UTF-8"?>
<ModelCriteria xmlns="">


Which will return output like:

<v2:Model xmlns:v2="" xmlns:xsi=""
        id="MyModelName" systemId="6141" label="managed" detail="MyModelName"


The key piece of information we need from that request is the systemId.


A little bit about our file (lorem-ipsum.txt):

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla.


  • File-size: 307
  • MD5 Sum: 22b229c7ecc49cfa11255beb06c7f4fe


The next step is to create a FileUploadSession and upload our file.  This will create for us the FileInfoReference we need to create our SoftwarePackage.




<?xml version="1.0"?>
<FileUploadSession xmlns=''>
    <file xmlns:xsi='' xsi:type='FileInfo'>


And our response if all goes OK (HTTP 200) looks like the following:

<v2:ExecutionResult xmlns:v2=""
        xmlns:xsi="" successful="true" totalCount="1">
        <v2:success xsi:type="v2:FileUploadSessionSuccessfulOperation">
            <v2:session systemId="16265" label="16265" detail="16265" 
                    <v2:file xsi:type="v2:FileInfo" id="1068731" systemId="1068731"
                        label="lorem-ipsum.txt" detail="1068731">


In this case, we just need the value of <v2:file systemId>, which is 1068731.





Extra Headers:

  • X-File-Name: lorem-ipsum.txt
  • X-File-Size: 307
  • Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

BODY:  There needs to be a mime-part called 'file-content' that contains the contents or lorem-ipsum.txt

Content-Disposition: form-data; name="file-content"; filename="cfk-lorem-ipsum.txt"
Content-Type: text/plain



Note:  If using Postman, SoapUI or other automated tool, this will be handled automatically for you - do not specify a Content-Type header in this case.


And our response, assuming an HTTP 200:

<v2:ExecutionResult xmlns:v2="" xmlns:xsi="" successful="true" totalCount="1">
    <v2:failures />


This is just confirming our success!  Excellent.  Now we come to the SoftwarePackage.  We need two key pieces of information, the ModelReference (6141) and the FileInfoReference (1068731):



Headers: Our defaults, Content-Type and x_axeda_wss_sessionid


<?xml version="1.0" encoding="UTF-8"?>
<SoftwarePackage xmlns="" xmlns:xsi="">
  <model systemId="6141" />

    <instruction xsi:type="DownloadFileInstruction">
      <file xsi:type="FileInfo" systemId="1068731"/>


And our results:

<v2:ExecutionResult xmlns:v2=""
         xmlns:xsi="" successful="true" totalCount="1">
    <v2:failures />



softwarepackage-screenshot.pngI hope this helps you in your projects, and helps demystify the Axeda Platform REST API a little for you.





Bibliography (Documents available from Support Portal):


Change History:

2015-09-24 : Change HTTP Methods of session create and content send to PUT from POST