# Get a full name in messenger

**URL:** <https://forum.rasa.com/t/get-a-full-name-in-messenger/25384>\
**Category:** Rasa Open Source\
**Created:** [February 28, 2020, 6:16am UTC](https://forum.rasa.com/t/get-a-full-name-in-messenger/25384 "2020-02-28T06:16:45Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Robert14](https://avatars.discourse-cdn.com/v4/letter/r/dbc845/32.png) [@Robert14](https://forum.rasa.com/u/Robert14)\
**Post date:** [February 28, 2020, 6:16am UTC](https://forum.rasa.com/t/get-a-full-name-in-messenger/25384/1 "2020-02-28T06:16:45Z")

</div>

hello rasa friends i have a issue about facebook messenger, well i tried to get a facebook full name with the request methon

```
class GetName(Action):
def name(self):
	return 'action_name'
	
def run(self, dispatcher, tracker, domain):
	import requests
	
	most_recent_state = tracker.current_state()
	sender_id = most_recent_state['sender_id']
	
	r = requests.get('https://graph.facebook.com/{}?fields=first_name,last_name,profile_pic&access_token={}'.format(sender_id, fb_access_token)).json()
	first_name = r['first_name']
	last_name = r['last_name']
	
	return [SlotSet('name', first_name), SlotSet('surname', last_name)]def run(self, dispatcher, tracker, domain):
	import requests
	
	most_recent_state = tracker.current_state()
	sender_id = most_recent_state['sender_id']
	
	r = requests.get('https://graph.facebook.com/{}?fields=first_name,last_name,profile_pic&access_token={}'.format(sender_id, fb_access_token)).json()
	first_name = r['first_name']
	last_name = r['last_name']
	
	return [SlotSet('name', first_name), SlotSet('surname', last_name)]`

```

but when the robot responds the server omit the action, the error what appear it´s

> ‘[https://graph.facebook.com/{}?fields=first\_name,last\_name,profile\_pic&access\_token={}](https://graph.facebook.com/%7B%7D?fields=first_name,last_name,profile_pic&access_token=%7B%7D)’.format(sender\_id, fb\_access\_token)).json() NameError: name ‘fb\_access\_token’ is not defined

so it any person that has appeared that incovenient i really appreciate the help

regards 😉 :

---

_[View the full topic](https://forum.rasa.com/t/get-a-full-name-in-messenger/25384)._
