- Previous: Media calls
- Up: Media calls
- Next: add sound
add image
Syntax
POST http://api.smart.fm/sentences/:sentence_id/images POST http://api.smart.fm/lists/:list_id/images POST http://api.smart.fm/images
Parameters
| Field: | Description: | Possible values: |
|---|---|---|
| api_key | Your iKnow! API key. | |
| image[url] |
Full http path to image. |
"http://farm.flick..." |
| image[file] |
Instead of a image[url] you can supply a multipart form uploaded file | "010101001110" |
| attribution[media_entity] |
Full HTTP path to the original work. | "http://www..." |
| attribution[author] |
Name or username of the author. | "John Doe" |
| attribution[author_url] |
Url to a profile of the author. | "http://www..." |
| attribution[attribution_license_id] |
A valid Creative Commons license id, see "Attribution Licenses". | 1, 2, 3, 4, 5, 6 |
Attribution Licenses
Formats
- Previous: Media calls
- Up: Media calls
- Next: add sound



Comments
Sam Joseph – 1 year ago
I just got image upload to work from android. I uploaded a random image to go with this sentence:
http://smart.fm/sentences/665130
HTTP/1.1 201 Created
X-Lighty-Magnet-Uri-Path: /sentences/665130/images
X-Mashery-Responder: mashery-web3.LAX
Server: nginx/0.6.32
Date: Wed, 29 Jul 2009 17:02:09 GMT
Content-Type: application/xml; charset=utf-8
Connection: keep-alive
X-Runtime: 3321ms
Cache-Control: no-cache
Location: http://api.smart.fm/images/303187
Accept-Ranges: bytes
Content-Length: 102
Response content length: 102
Chunked?: false
<image url="http://assets0.smart.fm/assets/users/tansaku/51b02798.jpg" creator="tansaku" id="303187"/>
I can see the link to the image here: http://api.smart.fm/sentences/665130.xml
<sentence href="http://smart.fm/sentences/665130" language="ja" id="665130">
<text>このびんはあけない。ちからまかせしないでな</text>
<image>
http://assets0.smart.fm/assets/users/tansaku/51b02798.jpg
</image>
<square_image>
http://assets2.smart.fm/assets/users/tansaku/51b02798_medium.jpg
</square_image>
<sound/>
but for some reason it does not show up in the api call to get the list with the sentences pulled in:
http://api.smart.fm/lists/57692/items.xml?include_sentences=true
<sentence href="http://smart.fm/sentences/665130" language="ja" id="665130">
<text>このびんはあけない。<b>ちからまかせ</b>しないでな </text>
<image/>
<square_image/>
<sound/>
Any idea why?
nov – 1 year ago
sorry, we don't support add image to sentence "in a specific list" yet.
our "add image" API is just adding a image to a sentence or a item without list context.
Michael Axiak – 5 months ago
Hey,
I just tried adding an image to an item, using http://api.smart.fm/items/:item_id/images and no matter what I do I get a 404 error. What gives? I've been using many different item ids and I've verified they all exist.
Cheers,
Mike
nov – 5 months ago
Sorry, we stopped attaching images to items.
Now no items are connected with images, that's why you are getting NOT FOUND response.
I fixed this legacy document.
Thanks
Michael Axiak – 5 months ago
Hey,
I tried with sentences with the same issue. Is there anything wrong with this request?
===================================
POST /sentences/862652/images HTTP/1.1
Accept-Encoding: identity
Content-Length: 95
Host: api.smart.fm
User-Agent: Python-urllib/2.6
Connection: close
Content-Type: application/x-www-form-urlencoded
Authorization: Basic _________
api_key=________________________&image%5Burl%5D=http%3A%2F%2Faxiak.net%2Fsounds%2Fkan4bing4.jpg
===================================
Again, it's giving me a 404 error. (The sentence does exist: http://smart.fm/sentences/862652 )
Thank you for your help!
Mike
Please sign in to post a comment.