Vendors need to check whether a music piece may be sold to a user, since some music has restrictions based on the user's location. The user's geographic location is determined using their IP address. Vendors will need to supply both the Legato music ID of the music and the user's IP address. The JSON method will return whether the music can be sold to the user.
checkLocation | ||
Description | Checks whether a music piece may be sold to a user based on their geographic location | |
Example | https://app.legatomedia.com/vend/checkLocation/<music_id>/<user_ip>/?username=<vendor_username>&api_key=<api_key> | |
e.g.: https://app.legatomedia.com/vend/checkLocation/146778/208.187.128.18/?username=vmusic&api_key=4f0400000000000000 | ||
Parameters | <music_id> | The Legato music ID of the music record |
<user_ip> | The user's IP address used to determine the their geographic location | |
<vendor_username> | Your Legato vendor username | |
<api_key> | Your Legato vendor API key | |
Returns | {"available": true, "success": true} | If the music is available |
{"available": false, "success": true} | If the music is not available | |
Possible Errors | invalid_music_id invalid_ip - indicates that the IP to Country lookup failed (unknown/invalid IP) |