In order to upload a PCAP to CloudShark, your integration should
perform an HTTP POST or PUT with the
contents of a completed capture file a URL matching the following pattern:
api-token fields should be
provided by the end user.
HTTP POST vs. PUT
When using the POST method, the contents of the file MUST be encoded as
and provided as the
file URL parameter.
If using the PUT method, the file MUST be
sent as binary data as the body of the HTTP request.
The CloudShark server will respond to successful uploads with an HTTP
200 response containing the newly created Capture as a JSON encoded
Your application can then provide a link to the CloudShark “session” for this upload:
We recommend directing users to only this URL as a starting point for their analysis.
If an API request fails for any reason, CloudShark will return a
non-200 HTTP response code. The response object will also
contain a text description of the error in the
"exceptions":["API Token is missing or invalid"]
Your application SHOULD inspect the status field, as well as any
exceptions given for why the upload failed. Common errors include
trying to upload with an invalid API Token, or uploading a file that is
larger than allowed.
CloudShark returns useful human-readable messages for all error
conditions. These may be passed onto the user or displayed in your interface
If your application does not get an HTTP 200 status code back, or if
the text response is not parsable as JSON, you MUST assume the upload
failed and return an error code to the user.
If you'd like to see usage-statistics for your integration, make sure you set
the HTTP User-Agent header on requests to something unique to your application
or integration. This could include a version number as well.
Contact us to find out how much your integration is being used!