Archived from the Transloadit support forum. Originally posted on November 16, 2013; details may be outdated, see our docs for current behavior. Original thread
Apparently no matter where I put my signature property, with the key of signature, the API doesn’t recognize that I’ve sent one. Can you give an an example of a json object that it will accept please?
Here is one of mine:
auth: Object
expires: "2013-11-16T21:51:53+0000"
key: "REDACTED"
template_id: "REDACTED"
__proto__: Object
signature: "09a8a0ebb1570905f2191d111b5d0a8d056c98aca84fbf48545d5ae14458c37c" steps: Object
export: Object
path: "users/images/${fields.s3UserId}/${previous_step.name}_${file.url_name}"
Note: I have tried moving signature within params, outside of it, and outside of the whole thing.
tim-kos
(Tim Koschützki)
November 17, 2013, 7:10am
2
It must be sent as a separate POST field named “signature”. Please your integration so that I can help further.
Kind regards,
Tim Koschuetzki
Co-Founder Transloadit
@tim_kos
It is finding the signature field. My mistake. It just doesn’t match the one I supply. my json object looks like this:
$('#myid').transloadit({
wait: true,
fields: '*',
processZeroFiles: false,
params: {
"auth": {
"expires": 2013-11-17T16:20:44+0000,
"key": myapikey
},
"template_id": mytemplateid,
"steps": {
"export": {
"path": 'users/images/${fields.s3UserId}/${previous_step.name}_${file.url_name}'
}
},
},
signature: '3dd208e3e801a4bdf8bf9adf838f5d93f208f9e3a8b4d5635966a0ab4264763d', autoSubmit: false,
onResult: function(step, result) {
},
onSuccess: function(assembly) {
}
});
};
and I am deriving the signature from this string:
“{“auth”:{“expires”:“2013-11-17T16:39:27+0000”,“key”:“REDACTED”},“template_id”:“mytemplateid”,“steps”: {“export”: {“path”: “users/images/${fields.s3UserId}/${previous_step.name}_${file.url_name}”}}}”
Does this string need to be encoded in any particular way? I didn’t find that information in your documentation.
Should it be sha1 or sha256? Does it make a difference?
tim-kos
(Tim Koschützki)
November 17, 2013, 4:46pm
5
Well you are sending a different value for “expires” compared to the one you use for the signature.
Have you seen our signature authentication examples for various languages here:
https://transloadit.com/docs/api-docs#authentication-implementations
Kind regards,
Tim
Co-Founder Transloadit
@tim_kos
Yes that’s because I copied and pasted the different values at different times. They are normally the same.
tim-kos
(Tim Koschützki)
November 18, 2013, 9:03am
7
Can you please paste the code that calculates the signature?
Also please take a look at this code: https://transloadit.com/example_apps/video-thumbnail-chooser/index.php It is useful to generate both the params and the signature in the backend with the same language.
Kind regards,
Tim
Co-Founder Transloadit
@tim_kos
tim-kos
(Tim Koschützki)
December 10, 2013, 6:49am
8
I am going to close this ticket for now. Please feel free to reopen it again if you have further questions.
Kind regards,
Tim
Co-Founder Transloadit
@tim_kos