I'm trying to just parse this so that I only get the name and bot_id
I used json.loads
and did things like
for item in response:
print item['bot_id']
Right now I'm just most concerned with getting the bot_id
def view_bot_ids():
response = json.loads(requests.get("https://api.groupme.com/v3/bots?token=CANTSHOWTHIS")._content)
print response
This is the output I am getting:
{
u'meta': {u'code': 200},
u'response': [
{u'group_id': u'49818165', u'name': u'Johnny Five',
u'dm_notification': False, u'group_name': u'Travis Manion Presentation',
u'avatar_url': None, u'callback_url': None,
u'bot_id': u'240b08e530d42f286f30a75379'
},
{u'group_id': u'48672722', u'name': u'Johnny Five',
u'dm_notification': False, u'group_name': u'DevOps Autodidact',
u'avatar_url': None, u'callback_url': None,
u'bot_id': u'64395a02a9382796f7cd7616ef'
},
{u'group_id': u'48402248', u'name': u'suck ya mom',
u'dm_notification': False, u'group_name': u'Free Flicks',
u'avatar_url': None, u'callback_url': None,
u'bot_id': u'42aacdb69615721d68c31d71c0'
},
{u'group_id': u'43195303', u'name': u'The goat',
u'dm_notification': False, u'group_name': u'2nd Floor Boiz',
u'avatar_url': None, u'callback_url': None,
u'bot_id': u'd45a95b6bbb344639104fd6a3a'
}
]
}
All I want from this, is all the bot_ids and name.
All I want it to output is the array of bot ids or array of names.