When I use the assembly http/import in combination with an upload it does not upload to s3

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

I’ve got code like the following in my rails app.

transloadit = Transloadit.new(:key => @transloadit_config[:api_key], :secret => @transloadit_config[:api_secret])

transloadit.assembly(
       {
        :steps => {
          :import => {
          :robot => "/http/import",
          :url => video_download_url
          },
          :encode_ipad => {
            :robot => "/video/encode",
            :preset => "ipad"
          },
          :export => {
            :robot => "/s3/store",
            :key =>  @transloadit_config[:aws_key],
            :secret =>  @transloadit_config[:aws_secret],
            :bucket => @transloadit_config[:aws_bucket]
          }
        },
        :notify_url => "#{notify_url}"
      }
    ).submit!

instead it shows up as this in params

{ "auth": {
    "expires": "2012/07/31 20:14:12+00:00",
    "key": "REDACTED"

}, “steps”: {

"export": {
  "robot": "/s3/store",
  "bucket": "****",
  "secret": "REDACTED",
  "key": "REDACTED"
},
"import": {
  "url": "******",
  "robot": "/http/import"
},
"encode_ipad": {
  "preset": "ipad",
  "robot": "/video/encode"
}

}, “notify_url”: “******” }

and it hits my notify url with the payload but it is not telling me about the final location on the aws… the results show that it uploaded

Results
encode_ipad

Name Type Size

1 c454098b-818c-49cd-abc6-c2a02ddb18a4.mp4 video 368 KB Details | Download

http://tmp.transloadit.com.s3.amazonaws.com/REDACTED

But I want this to be my amazon bucket…

Am I doing something wrong here where I need to be using two templates to get the order proper?

Hey Josh,

if you do not provide the “use” parameter, our robots work in the order that you specify them. In your case this results in the store step not having to store anything.

Just add :use => “import” to the encode step and add :use => “encode_ipad” to your store step and you should be good.

Kind regards,
Tim

Tim,

Thanks for the tip. I followed your instructions somewhat, but might have got them backwards as I didn’t really get any good results.

I used this method. The link is below.. not sure if that works for you…

{
"notify_url": "[https://lms.dev.empowered.com/api/v1/courses/47/video_transcoders/discussiontopic/593?access_token=&as_user_id=110&quot](https://lms.dev.empowered.com/api/v1/courses/47/video%5Ftranscoders/discussiontopic/593?access%5Ftoken=&as%5Fuser%5Fid=110&quot);,
"auth": {
"expires": "2012/07/31 22:35:40+00:00",
"key": "REDACTED"
},
"steps": {
"export": {
"bucket": "lms-video-dev1-empowered-com",
"secret": "REDACTED",
"key": "REDACTED",
"robot": "/s3/store"
},
"import": {
"url": "[https://s3.amazonaws.com/tokbox.com.staging/13651582/db2ed464-4b21-4051-9427-bceeff960042/c454098b-818c-49cd-abc6-c2a02ddb18a4.flv?Signature=TTZRMmgGUFZ5pix4owtwqqTR6I8%3D&Expires=1343777362&AWSAccessKeyId=REDACTED&quot](https://s3.amazonaws.com/tokbox.com.staging/13651582/db2ed464-4b21-4051-9427-bceeff960042/c454098b-818c-49cd-abc6-c2a02ddb18a4.flv?Signature=TTZRMmgGUFZ5pix4owtwqqTR6I8%3D&Expires=1343777362&AWSAccessKeyId=REDACTED&quot);,
"use": "encode_ipad",
"robot": "/http/import"
},
"encode_ipad": {
"use": "import",
"preset": "ipad",
"robot": "/video/encode"
}
}
}

I attempted another way… below… worked!!!

{
"notify_url": "[https://lms.dev.empowered.com/api/v1/courses/47/video_transcoders/discussiontopic/593?access_token=&as_user_id=110&quot](https://lms.dev.empowered.com/api/v1/courses/47/video%5Ftranscoders/discussiontopic/593?access%5Ftoken=&as%5Fuser%5Fid=110&quot);,
"auth": {
"expires": "2012/07/31 22:39:49+00:00",
"key": "REDACTED"
},
"steps": {
"export": {
"bucket": "lms-video-dev1-empowered-com",
"secret": "REDACTED",
"use": "encode_ipad",
"key": "REDACTED",
"robot": "/s3/store"
},
"import": {
"url": "[https://s3.amazonaws.com/tokbox.com.staging/13651582/db2ed464-4b21-4051-9427-bceeff960042/c454098b-818c-49cd-abc6-c2a02ddb18a4.flv?Signature=TTZRMmgGUFZ5pix4owtwqqTR6I8%3D&Expires=1343777362&AWSAccessKeyId=REDACTED&quot](https://s3.amazonaws.com/tokbox.com.staging/13651582/db2ed464-4b21-4051-9427-bceeff960042/c454098b-818c-49cd-abc6-c2a02ddb18a4.flv?Signature=TTZRMmgGUFZ5pix4owtwqqTR6I8%3D&Expires=1343777362&AWSAccessKeyId=REDACTED&quot);,
"robot": "/http/import"
},
"encode_ipad": {
"use": "import",
"preset": "ipad",
"robot": "/video/encode"
}
}
}

Looks like I was a little confused when you said the “store step” as I interpreted this as import and it is supposed to be export :slight_smile:

You’re the man.

Thanks so much.

~Josh

You are welcome.

Closing this.