- Previous: add image
- Up: Media calls
- Next: Favorites calls
add sound
Syntax
POST http://api.smart.fm/sounds POST http://api.smart.fm/items/:item_id/sounds POST http://api.smart.fm/sentences/:sentence_id/sounds
Parameters
| Field: | Description: | Possible values: |
|---|---|---|
| api_key | Your iKnow! API key. | |
| sound[url] |
Full http path to sound. |
"http://farm.flick..." |
| sound[file] | Alternatively, post a multipart form file | <multipart form> |
| sound[text] | Optional transcript text | "hello" |
| sound[language] | Optional language | 'en', 'ja', 'fr' |
| media_entity |
Full HTTP path to the original work. | "http://www..." |
| author |
Name or username of the author. | "John Doe" |
| author_url |
Url to a profile of the author. | "http://www..." |
| attribution_license_id |
A valid Creative Commons license id, see "Attribution Licenses". | 1, 2, 3, 4, 5, 6 |
This call requires an API Key and Authentication.
Attribution Licenses
Formats
- Previous: add image
- Up: Media calls
- Next: Favorites calls



Comments
Sam Joseph – 1 year ago
Hmm, so I am trying to upload a sound file, and I am getting a developer inactive response:
POST /items/773990/sounds HTTP/1.1
Authorization: Basic <hidden>
Host: api.smart.fm
Content-Length: 3795
Content-Type: multipart/form-data; boundary=peJTjr14-6IFyvZWyGWm7JRrG3fm-JsE2
Connection: Keep-Alive
User-Agent: Apache-HttpClient/UNAVAILABLE (java 1.4)
Expect: 100-Continue
Content-Disposition: form-data; name="bin"; filename="test.3gpp"
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
<sound file>
--peJTjr14-6IFyvZWyGWm7JRrG3fm-JsE2
Content-Disposition: form-data; name="media_entity"
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
--peJTjr14-6IFyvZWyGWm7JRrG3fm-JsE2
Content-Disposition: form-data; name="author"
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Sam Joseph
--peJTjr14-6IFyvZWyGWm7JRrG3fm-JsE2
Content-Disposition: form-data; name="author_url"
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
http://smart.fm/users/tansaku
--peJTjr14-6IFyvZWyGWm7JRrG3fm-JsE2
Content-Disposition: form-data; name="attribution_license_id"
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
1
--peJTjr14-6IFyvZWyGWm7JRrG3fm-JsE2
Content-Disposition: form-data; name="item_id"
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
773990
--peJTjr14-6IFyvZWyGWm7JRrG3fm-JsE2
Content-Disposition: form-data; name="api_key"
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
<hidden>
--peJTjr14-6IFyvZWyGWm7JRrG3fm-JsE2--
HTTP/1.1 403 Forbidden
X-Lighty-Magnet-Uri-Path: /items/773990/sounds
X-Mashery-Responder: mashery-1.cust.tyo.llnw.net
X-Mashery-Error-Code: ERR_403_DEVELOPER_INACTIVE
Content-Type: text/xml
Accept-Ranges: bytes
Content-Length: 31
Date: Wed, 27 May 2009 02:00:46 GMT
Server: lighttpd/1.4.20
<h1>403 Developer Inactive</h1>
Sam Joseph – 1 year ago
I've double checked and I can still create a new list item via my existing api key and authorization code, and I can't find much helpful when searching for mashery "developer inactive" - seems like this is something that SmartFM sets as part of it's mashery entry?
BTW, I would still love to see documentation on all the different return codes, e.g. I just got a couple testing if create item would still work ...
HTTP/1.1 201 Created [body is <item id>]
HTTP/1.1 400 Bad Request [body is "item: Text kanji-kanja-not-allowed-in-cue"]
nov – 1 year ago
I checked this issue, and I also failed.
Now, I'm asking about it to Mashery.
Please wait a bit.
thanks
Sam Joseph – 1 year ago
Thanks - any feedback from mashery on the reason that this isn't working?
nov – 1 year ago
Sorry for the delay.
Mashery engineers are looking into this issue.
I will get back to you when I receive a response.
nov – 1 year ago
Hi sam
Finally, we fixed all problems.
You can upload image now.
thanks
Sam Joseph – 11 months ago
thanks - and Dom about to provide AMR support so will be all sorted.
one question though, the docs have an asterisk like so "*Container is a namespace eg: cue[text]. Please see example code for more clarity.", but it doesn't seem to refer to anything - is this something that might allow the audio uploaded to be associated with cue versus response etc?
Sam Joseph – 11 months ago
sound uploading for AMR working. Hooray!
Now it would just be great if we could upload sound for responses and translations, as well as cues and examples ...
Sam Joseph – 11 months ago
oh yeah, and gender seems to default to female - is there no way to set sound meta-data?
HTTP/1.1 201 Created
X-Lighty-Magnet-Uri-Path: /sentences/688825/sounds
X-Mashery-Responder: mashery-web1.LAX
Server: nginx/0.6.32
Date: Wed, 26 Aug 2009 16:47:40 GMT
Content-Type: application/xml; charset=utf-8
Connection: keep-alive
X-Runtime: 1043ms
Cache-Control: no-cache
Location: http://api.smart.fm/sounds/1057092
Accept-Ranges: bytes
Content-Length: 181
<sound created_at="Wed Aug 26 16:47:40 UTC 2009" voice_gender="female" is_human="true" id="1057092"><location>/assets/users/tansaku/cl8pfb8psphd8.mp3</location><text></text></sound>
Michael Axiak – 10 months ago
Hi,
I'm getting the error: "Creator can't be blank"
Here's my post:
URL: http://api.smart.fm/items/1541087/sounds
POST_DATA:
api_key=p2s34dbe7x9v3b5bk2fe7wfb&sound%5Bfile%5D=http%3A%2F%2Fzetazero.mit.edu%2Foutput%2Fxian1.mp3
Please sign in to post a comment.