SongShare API Documentation
METHOD: https://www.appmosys.com/songshare/api/shareSong
This method will share a song on SongShare for the specified Twitter user.
The method supports:
- HTTP GET or POST
- UTF-8 character encoding
Notes:
- A secure connection (HTTPS) is required. This is done to protect both the user's credentials and your api key.
- You MUST URL encode all fields that may contain special characters (username, password, title, artist, album, message)
Input parameters:
- username (required) - The Twitter account posting the share
- password (required) - The password for the Twitter account posting the share
- api_key (required) - Your SongShare API key. Request one for free by filling out our contact form with a note requesting an API key and providing your company and app name and website URL.
- title (required) - The song title
- artist - The song artist
- album - The song album
- message - An optional message to go along with the share. Limited to 1024 UTF-8 characters. It is a good idea to not include hashtags such as #nowplaying in the message but to instead add them later when you post to Twitter as this keeps the actual messages on SongShare much cleaner.
- post_if_not_found (optional, default = true) - If you provide title/artist/album parameters and no match is found for the song, by default a share will be created listing the title/artist/album you provided, but with no album art or preview. If post_if_not_found is set to false and no match is found for the song, no share will be created and a "No Results" error will be returned.
- response_format (optional, default = XML) - The format of the response. Acceptable values are (XML, JSON). If not specified the default is XML.
Outputs:
- status - 'ok' or 'fail'
- url - The URL linking to your share
- errorCode - Error code, if applicable
- errorDescription - Description of the error, if applicable
Sample inputs and responses:
Input:
https://www.appmosys.com/songshare/api/shareSong?username=theuser&password=secret&api_key=123xyz&artist=dave+matthews&title=stay+or+leave&album=some+devil&description=cool+song
Response:
<?xml version="1.0" encoding="UTF-8"?> <SongShareResponse> <status>ok</status> <url>http://songshare.fm/a9</url> </SongShareResponse>
JSON response:
{"status":"ok","url":"http:\/\/songshare.fm\/a9"}
Error response:
<?xml version="1.0" encoding="UTF-8"?> <SongShareResponse> <status>fail</status> <errorCode>1002</errorCode> <errorDescription>Missing or invalid SongShare API key</errorDescription> </SongShareResponse>
Error codes and descriptions:
- 1001: Invalid Twitter username or password
- 1002: Missing or invalid SongShare API key
- 1003: Missing title parameter
- 1004: No results - this error will be returned if post_if_not_found is set to false and we are unable to find a match for your song
- 1005: This user is over the rate limit. Please wait a bit and try again.
- 1006: Unknown error
