Track user ID passed in the GET request

This is generated by the code I use from you.

def submit(self, dispatcher, tracker, domain):
        
        agree_info = AgreeInfo()
        booking = agree_info.save(tracker.latest_message.get("text"))
        #user_id = tracker.sender_id
        user_id = (tracker.current_state())["sender_id"]
        print ("user id: " + user_id)
        print (tracker.latest_message.get("text"))

commented line will also work!

But now the problem is to replace the default to a certain user_id right? As my code get the user_id by rasa, still doesnt work

Okay try this ! Run the bot by enabling api and then do local host call with a user_id like 123

http://localhost:5005/conversations/123/respond?q=hi

Now do tracker call in postman

http://localhost:5005/conversations/123/tracker

Check out the answer if coming, then try your tracker saving action

I think it was because I didnt enable api using --enable_api

Now, I use the user_id generated by rasa and it works on postman

But now, I put the requests code back and it doesn’t work again… I used the user_id and tried on postman, but it just stuck and no response. The idea is to use requests to get the log and save to a txt file.

@Akshit or do you know is there any other method that I can pull out the log and save it to a txt file for each user without using requests?

Also I found out the postman responded until I stopped my action server and it showed the log.

Sorry I haven’t worked on something like that! I’ll send a link if I find something :slight_smile:

Hi, @Akshit did you figure this out? I am also trying to get the recipient_id in custom actions, but the answers here only talk about sender_id, which is not the same

I know how to get sender_id in actions but not sure how to change it via the API call. I get the default sender_id for now.

Also for info, I use parse msg API Rasa & Rasa Pro Documentation