In [1]:
from memair import Memair
# Use Otto the sandbox user's access token or create your own at https://memair.com/temporary_access_token
access_token = '0000000000000000000000000000000000000000000000000000000000000000'

user = Memair(access_token)
In [2]:
recommendation = user.query('''
    mutation {
      CreateRecommendation(
        priority: 73.9
        type: video
        expires_at: tomorrow
        url: "https://youtu.be/LQCoHLQkFxw"
      )
      {
        id
        timestamp
        is_expired
        is_actioned
      }
    }
''')

recommendation_id = recommendation['data']['CreateRecommendation']['id']
recommendation
Out[2]:
{'data': {'CreateRecommendation': {'id': '10',
   'timestamp': '2018-11-22T20:40:19Z',
   'is_expired': False,
   'is_actioned': False}}}
In [3]:
user.query('''
    mutation {
      ActionRecommendation(
        id: %s
        actioned_at: yesterday
      )
      {
        id
        is_actioned
        actioned_at
      }
    }
''' % recommendation_id)
Out[3]:
{'data': {'ActionRecommendation': {'id': '10',
   'is_actioned': True,
   'actioned_at': '2018-11-21T05:00:00Z'}}}
In [4]:
user.query('''
    mutation delete_recommendation{
      DeleteRecommendation(
        id: %s
      )
    }
''' % recommendation_id)
Out[4]:
{'data': {'DeleteRecommendation': True}}