Skip to content

Instantly share code, notes, and snippets.

@coreyar
Last active September 15, 2018 21:41
Show Gist options
  • Save coreyar/d8ef19f240a34cebef1ce79a6ed941bc to your computer and use it in GitHub Desktop.
Save coreyar/d8ef19f240a34cebef1ce79a6ed941bc to your computer and use it in GitHub Desktop.
Nashville Music Hackathon RAI Api information

Bearer Token

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoiZXh0ZXJuYWwiLCJhY2NvdW50SWQiOiI1Yjk5M2QxMDA0YmJhZDJlMjU4YjMyNTAiLCJzZXNzaW9uSWQiOiJhMDEzNzA3Mi0wZDFiLTQ4ZWEtODNlMy01YWVmMDkzNzc3NzQiLCJpYXQiOjE1MzY3NjkzMjQsImV4cCI6MTUzNzM3NDEyNH0.eDoL4cATx__N5pP-s4BlrsYsbn8PtQl0MWVBYr_yapk

Docs

The RAI API has two endpoints Parse and Resolve. RAI documentation

Python Example

import requests

token = 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoiZXh0ZXJuYWwiLCJhY2NvdW50SWQiOiI1Yjk5M2QxMDA0YmJhZDJlMjU4YjMyNTAiLCJzZXNzaW9uSWQiOiJhMDEzNzA3Mi0wZDFiLTQ4ZWEtODNlMy01YWVmMDkzNzc3NzQiLCJpYXQiOjE1MzY3NjkzMjQsImV4cCI6MTUzNzM3NDEyNH0.eDoL4cATx__N5pP-s4BlrsYsbn8PtQl0MWVBYr_yapk'

headers = { 'Authorization': token }


# Parse 
data = { 'title': 'Shake It Off' }
r = requests.post('https://api.cultofrai.com/api/parse', headers=headers, data=data)
print(r.text)

# Resolve
params = { 'albumTitle': 'Shake It Off' }
r = requests.get('https://api.cultofrai.com/api/resolve', headers=headers, params=params)
print(r.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment