Get signature generated with PHP SDK

Archived from the Transloadit support forum. Originally posted on November 7, 2013; details may be outdated, see our docs for current behavior. Original thread

Hi, again Team!,
This time my question is about using de PHP SDK.
I was wondering how can I get the signature generated by the Transloadit class when I call the createAssembly method, so when the notification arrives to the notify_url set, I can compare tha signature with the one generated earlier.
I was looking at this method, and Transloadit class instantiate a TransloaditRequest class but this is never public to check.

Hope I was clear,

Kind regards

Marce Romagnoli
GuiaLocal.com
@mromagnoli

Hey Marce,

check here: https://github.com/transloadit/php-sdk/blob/master/lib/transloadit/Transloadit.php

Notice how you can pass a parameter $execute = true || false to the request() method. If you pass false, it will return the $request object for you, which has access to the signature at $request->fields[‘signature’].

You can then run $request->execute() after that.

Kind regards,
Tim

Co-Founder Transloadit
@tim_kos

Indeed, I was looking that. But this is useful if you call request() method, but I am calling createAssembly() method, and it calls request() method internally, so I can’t pass any params since it only accepts $options as params.

Hey Marce,

I see. Maybe you could send a Pull Request that fixes this. For example request() could always save the last request to Transloadit->request, so that it’s accessible.

We’ll see what the maintainer of the SDK things about that.

Thanks Tim, I will go that way.

Kind regards

Marce Romagnoli
GuiaLocal.com
@mromagnoli

Alright cool.

Please let me know how it goes. Closing this in the meantime.