HTTPS GET [web_admin_domain]/oauth/authorize
client_id required. The app's key, found in the administration panel
redirect_uri required. Where to redirect the user after authorization has completed. This must be the exact URI registered in the administration panel
scope Possible values are 'read' or 'write'. The default value is 'read'
state Bytes of arbitrary data that will be passed back to your redirect URI. This parameter should be used to protect against cross-site request forgery (CSRF).
HTTPS GET [web_admin_domain]/oauth/authorizewithaccesskey?accesskey=[accesskey]
If the connection is not secure the access key must be encrypted using a key and an algorithm which they can be obtained by calling [web_admin_domain]/oauth/getpublickey
success = true,
data = [ the accessToken ],
expires_in: "7200"
}
HTTPS GET [web_admin_domain]/oauth/getPublickey
Rsa Wiki | Rsa OpenSSL
* Openssl Command Line Example for encryption: $ openssl rsautl -encrypt -inkey public.pem -pubin -in file.txt -out file.ssl
success = true,
key = 'the key in PEM format' ],
algorithm = 'rsa'.
}
HTTPS POST [web_admin_domain]/oauth/token
grant_type required. The grant type, which must be authorization_code.
client_id required. The app's key
client_secret required. The app's secret.
redirect_uri Only used to validate that it matches the original /oauth/authorize, not used to redirect again.
access_token: "gAAAAHI9GG07oCsv1aC-4_GBPQVPxdb85rtGZlrvVOSA......,
expires_in: "7200",
token_type: "bearer" }
HTTPS POST [web_admin_domain]/oauth/refreshToken
client_id required. The client identifier
client_secret required. The clients secret
* Add the following header to your request. Content-Type: application/x-www-form-urlencoded
* Body Example: refreshToken=someToken&client_id=clID&client_secret=clSecret
access_token: "gAAAAHI9GG07oCsv1aC-4_GBPQVPxdb85rtGZlrvVOSA......,
expires_in: "7200",
}
HTTPS GET [api_admin_domain]/api/tags/listtags
success = true,
data = [ {TagID: 1, TagName: images}, {TagID: 12, TagName: embroidery} ]
}
HTTPS POST [api_admin_domain]/api/tags/postTag/{tagName}
success = true,
data = {TagID: 15, TagName: theNewTagName}
}
HTTPS PUT [api_admin_domain]/api/tags/RenameTag/{tagName}?newTagName={theNewNameOfTheTag}
success = true,
data = {TagID: 15, TagName: theNewNameOfTheTag}
}
HTTPS DELETE [api_admin_domain]/api/tags/DeleteTag/{tagName}
success = true,
data = ""
}
HTTPS GET [api_admin_domain]/api/tags/GetTagsInFiles/{fileId}
success = true,
data = [ {TagID: 1, TagName: images}, {TagID: 12, TagName: embroidery} ]
}
HTTPS GET [api_admin_domain]/api/files/GetFile/{fileName}
HTTPS POST [api_admin_domain]/api/files/postFile
success = true,
data = "Your file with name {the file name} has been successfully uploaded
}
HTTPS GET [api_admin_domain]/api/files/ListFiles/{TagID}?partName={partOfTheFileName}
partOfTheFileName not required. Part of the file name.
success = true,
data = [ {Name: A1.jpg, NumBytes: 102911, NumStitches: null, FileType: Generic}, {Name: B1.PXF, NumBytes: 64999, NumStitches: 454585, FileType: Embroidery} ]
}
HTTPS GET [api_admin_domain]/api/files/getMetadata/{fileName}
success = true,
data = {Name: B1.PXF, NumBytes: 64999, NumStitches: 454585, FileType: Embroidery}
}
HTTPS GET [api_admin_domain]/api/files/getThumbnail/{fileName}
HTTPS PUT [api_admin_domain]/api/files/RenameFile/{fileName}?newName={theNewFileName}
theNewFileName required. The new file name
success = true,
data = {Name: NewName.PXF, NumBytes: 64999, NumStitches: 454585, FileType: Embroidery}
}
HTTPS DELETE [api_admin_domain]/api/files/DeleteFile/{fileName}
success = true,
data = ""
}
HTTPS POST [api_admin_domain]/api/files/SetFileInTag/{fileName}?TagID={tagID}
tagID required. The tag id of the Tag need to be associated with the file
success = true,
data = {Name: MyDesign.PXF, NumBytes: 18984, NumStitches: 54545, FileType: Embroidery}
}
HTTPS GET [api_admin_domain]/api/machines/GetMachinesList/
success = true,
data = [ {MachineName: MAC-02345, SpoolerName:Spooler-Name1 , DesignSpoolerId: 1eee11132-e4b9-4216-9ae4-2c5b4af2fa8e}, {MachineName: MAC-02345-2, SpoolerName:Spooler-Name2 , DesignSpoolerId: 1fff11132-e4b9-4216-901e4-2c5b4af2fa8e} ]
}
HTTPS POST [api_admin_domain]/api/machines/AddMachineEvent/
MachineName required. The name of the machine
DesignSpoolerName required. The name of the spooler
DesignSpoolerId required. The id of the spooler
TimeStamp. The timestamp of the event. Example: 2014-06-12 12:00
Reason. The reason of the event.
DesingName. THe design name associated with the event
* Add the following header to your request. Content-Type: application/x-www-form-urlencoded
* Body Example: EventType=MachineStopped&MachineName=Machine1&DesignSpoolerName=SpoolerName1&DesignSpoolerId=Sppoler_12&TimeStamp=2014-06-12 12:00&Reason=SomeReason&DesingName=sample.pxf
success = true,
data = 7
}
HTTPS POST [api_admin_domain]/api/machines/AddMachine/
DesignSpoolerName required. The name of the spooler
DesignSpoolerId required. The id of the spooler
* Add the following header to your request. Content-Type: application/x-www-form-urlencoded
* Body Example: MachineName=Machine1&DesignSpoolerName=SpoolerName&DesignSpoolerId=SpoolerID_345
success = true,
data = 134
}
HTTPS POST [api_admin_domain]/api/synchronization/StartSynchingQueue
spoolerDesigns required. List of spoolerInfo object. A spoolerInfo object is an object with 2 properties.
ID: of the design (has to be a unique id foreach design spooler's or clouds...perhaps a GUID. This id will be used to synch the queues)
IsSpoolersDesign: A boolean property to determine if a design is added through cloud or through other clients. false->cloud, true->other clients
* Add the following header to your request. Content-Type: application/x-www-form-urlencoded
*Body Example:
spoolerID=Spooler_12&SpoolerDesigns[0].ID=abc1234&SpoolerDesigns[0].IsSpoolersDesign=true&SpoolerDesigns[1].ID=efg567SpoolerDesigns[1].IsSpoolersDesign=false
success: true,
postToCloud:[{ID:some id, IsSpoolersDesign=true}, {...}],
getFromCloud: [{ID:... ,IsSpoolersDesign=false},{....}],
removeFromSpooler: [{ID:... ,IsSpoolersDesign=false},{....}]
}
HTTPS GET [api_admin_domain]/api/synchronization/getDesign?id=[designID]&spoolerID=[spoolerID]
spoolerID required. The spooler id which design belongs to
success: true,
name:"sample.pxf",
MachineName: "Machine1",
ID: "designID",
TimeStamp: "2014-06-12 12:50" **this is the datetime that the user requested to send it to a machine,
ListComments:[
{ Comment : "The comment's text 1", ShowBeforeSewing : false, ShowAfterSewing : true },
{ Comment : "The comment's text 2", ShowBeforeSewing : true, ShowAfterSewing : false }
]
}
HTTPS POST [api_admin_domain]/api/synchronization/PostDesign
This information consists of the following properties: Name (the design name), MachineName (the machine name), ID (the design id),
IsSpoolersDesign (boolean if it's spooler's design or not), TimeStamp (the datetime added to the machine.)
spoolerID required. The spooler id
* Add the following header to your request. Content-Type: application/x-www-form-urlencoded
* Body Example: spoolerID=Spooler_12&ID=designID&IsSpoolersDesign=true&Name=designName&MachineName=machineName&TimeStamp=2014-06-25 12:50
success: true,
}
HTTPS POST [api_admin_domain]/api/synchronization/FinishSynchingQueue
* Add the following header to your request. Content-Type: application/x-www-form-urlencoded
* Body Example: spoolerID=Spooler_12
success: true,
}
Each time an error occured the success property of the json-encoded returned message will be false
In addition to, there will be another property "ErrorMessage" that will contain a message which will describe the error. See below an example
success = false,
ErrorMessage="Invalid access token"
}
Finally, these error results will be accompanied with some status codes.
403: The acces token used for the request in not valid
401: The acces token used for the request is not valid because the user that owns the resource have disable the access permission
400: In general bad request. Make sure you have used the right method for the request (get, post, put, or delete)
500: Internal Server Error. Smothing bad happened in the server