5.3. Check Location

Modified on Tue, May 25, 2021 at 9:12 AM

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
DescriptionChecks whether a music piece may be sold to a user based on their geographic location
Examplehttps://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 Errorsinvalid_music_id
invalid_ip - indicates that the IP to Country lookup failed (unknown/invalid IP)

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article