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

ID
License
1 Attribution-Noncommercial-Share Alike 2.0
2 Attribution-Noncommercial 2.0
3 Attribution-Noncommercial-No Derivative Works 2.0
4 Attribution 2.0
5 Attribution-Share Alike 2.0
6 Attribution-No Derivative Works 2.0
7 Attribution-Noncommercial-Share Alike 3.0
8 Attribution-Noncommercial 3.0
9 Attribution-Noncommercial-No Derivative Works 3.0
10 Attribution 3.0
11 Attribution-Share Alike 3.0
12 Attribution-No Derivative Works 3.0

Formats

  • XML

Comments

  1. Sam Joseph1 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?

  2. nov1 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.

  3. Michael Axiak5 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

  4. nov5 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

  5. Michael Axiak5 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.