# /http/import question

**URL:** <https://community.transloadit.com/t/http-import-question/17865>\
**Category:** Transloadit\
**Tags:** tender-archive\
**Created:** [February 18, 2011, 3:54pm UTC](https://community.transloadit.com/t/http-import-question/17865 "2011-02-18T15:54:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ARoth](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/aroth/32/1501_2.png) [@ARoth](https://community.transloadit.com/u/ARoth)\
**Post date:** [February 18, 2011, 3:54pm UTC](https://community.transloadit.com/t/http-import-question/17865/1 "2011-02-18T15:54:00Z")

</div>

> Archived from the Transloadit support forum. Originally posted on February 18, 2011; details may be outdated, see [our docs](https://transloadit.com/docs/) for current behavior. [Original thread](https://web.archive.org/web/20140409133447/http://support.transloadit.com/discussions/questions/98-httpimport-question)

I’m having a little trouble getting the /http/import robot to work using the REST API. Can anybody spot the problem below?

```auto
require 'rubygems'
require 'openssl'
require 'json'
require 'net/http'

auth_key = 'XXXX'
auth_secret = 'XXXX'

image_url = 'http://transloadit.com/img/robots/http-import.jpg'

params = JSON.generate({:auth => {
  :expires => Time.now.utc.strftime('%Y/%m/%d %H:%M:%S+00:00'),
  :key => auth_key,
  :robot => "/http/import",
  :url => image_url
}})

digest = OpenSSL::Digest::Digest.new('sha1')
signature = OpenSSL::HMAC.hexdigest(digest, auth_secret, params)

http = Net::HTTP.new("api2.transloadit.com")
request = Net::HTTP::Post.new("/?signature=#{ signature }")
request.set_form_data( { :params => params })
response = http.request( request )

```

The request goes through, but all I get back is an ‘OK’. I doubt I’m posting to the right place or with the right params.

---

<div class="post-metadata">

**Author:** ![kvz](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/kvz/32/606_2.png) [@kvz](https://community.transloadit.com/u/kvz)\
**Post date:** [February 18, 2011, 4:10pm UTC](https://community.transloadit.com/t/http-import-question/17865/2 "2011-02-18T16:10:00Z")

</div>

Hey Adam,

At first glance I can’t spot a problem, but since your language is  
Ruby have you considered testdriving our gem?  
[http://rubygems.org/gems/transloadit/](http://rubygems.org/gems/transloadit/)

Should make working with our API even easier : )

Let me know if that doesn’t work out, so we can go in-depth and solve your problem.

---

<div class="post-metadata">

**Author:** ![ARoth](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/aroth/32/1501_2.png) [@ARoth](https://community.transloadit.com/u/ARoth)\
**Post date:** [February 18, 2011, 4:20pm UTC](https://community.transloadit.com/t/http-import-question/17865/3 "2011-02-18T16:20:00Z")

</div>

Just discovered the github repo. I’m on it.

---

<div class="post-metadata">

**Author:** ![Felix\_Geisendorfer](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/felix_geisendorfer/32/1463_2.png) [@Felix\_Geisendorfer](https://community.transloadit.com/u/Felix_Geisendorfer)\
**Post date:** [February 18, 2011, 4:24pm UTC](https://community.transloadit.com/t/http-import-question/17865/4 "2011-02-18T16:24:00Z")

</div>

Hi Adam, sorry but the gem is not quite ready yet. Anyway, are you sure you are getting “OK” back? Can you paste the full output?

Your JSON has multiple problems. Most importantly your http import step needs to be wrapped in a “steps” key, and your “expires” / “key” properties need to be wrapped in an “auth” key. I’m surprised if you wouldn’t get a more meaningful error message on this.

--fg

---

<div class="post-metadata">

**Author:** ![ARoth](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/aroth/32/1501_2.png) [@ARoth](https://community.transloadit.com/u/ARoth)\
**Post date:** [February 18, 2011, 4:34pm UTC](https://community.transloadit.com/t/http-import-question/17865/5 "2011-02-18T16:34:00Z")

</div>

I reorganized my code and am getting a lot further…

```auto
{"error":"ASSEMBLY_STEP_INVALID","message":"One of your {steps: ...} parameters is a non-object value.","reason":"{\"url\":\"http://transloadit.com/img/robots/http-import.jpg\"}"}

```

…can you spot the problem in “steps” ?

```auto
params = JSON.generate({
    :auth => {
      :expires => ( Time.now + 10.minutes ).utc.strftime('%Y/%m/%d %H:%M:%S+00:00'),
      :key => auth_key,
    },
    :steps => {
      :robot => "/http/import",
      :url => url
    }
})

```

---

<div class="post-metadata">

**Author:** ![ARoth](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/aroth/32/1501_2.png) [@ARoth](https://community.transloadit.com/u/ARoth)\
**Post date:** [February 18, 2011, 4:38pm UTC](https://community.transloadit.com/t/http-import-question/17865/6 "2011-02-18T16:38:00Z")

</div>

I think I’m good:

```auto
params = JSON.generate({
    :auth => {
      :expires => ( Time.now + 10.minutes ).utc.strftime('%Y/%m/%d %H:%M:%S+00:00'),
      :key => auth_key,
    },
    :steps => {
      :import_existing => {
        :robot => "/http/import",
        :url => url
      }
    }
})

```

Thanks.

---

<div class="post-metadata">

**Author:** ![tim-kos](https://avatars.discourse-cdn.com/v4/letter/t/bbe5ce/32.png) [@tim-kos](https://community.transloadit.com/u/tim-kos)\
**Post date:** [February 18, 2011, 5:15pm UTC](https://community.transloadit.com/t/http-import-question/17865/7 "2011-02-18T17:15:00Z")

</div>

Glad you figured it out. Closing this for now.

Kind regards,  
Tim

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex032/uploads/transloadit/original/1X/04ee57da0cb7ac8728a9ac5965c288164f4ce280.svg) [@system](https://community.transloadit.com/u/system)\
**Post date:** [October 7, 2026, 9:14am UTC](https://community.transloadit.com/t/http-import-question/17865/8 "2026-10-07T09:14:19Z")

</div>


