signature JSON object structure

Started by antonygraemecox7 replies28 views
antonygraemecoxOriginal post
#1

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: "REDACTED" 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
#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

antonygraemecox
#3

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: 'REDACTED', 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.

antonygraemecox
#4

Should it be sha1 or sha256? Does it make a difference?

antonygraemecox
#6

Yes that’s because I copied and pasted the different values at different times. They are normally the same.

tim-kos
#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