# Rasa with webservice

**URL:** <https://forum.rasa.com/t/rasa-with-webservice/12949>\
**Category:** Rasa Open Source\
**Created:** [July 15, 2019, 12:30pm UTC](https://forum.rasa.com/t/rasa-with-webservice/12949 "2019-07-15T12:30:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sunilskn](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@sunilskn](https://forum.rasa.com/u/sunilskn)\
**Post date:** [July 15, 2019, 12:30pm UTC](https://forum.rasa.com/t/rasa-with-webservice/12949/1 "2019-07-15T12:30:13Z")

</div>

I want webservice response as a intent

---

<div class="post-metadata">

**Author:** ![gcgloven](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/gcgloven/32/3915_2.png) [@gcgloven](https://forum.rasa.com/u/gcgloven)\
**Post date:** [July 16, 2019, 1:53am UTC](https://forum.rasa.com/t/rasa-with-webservice/12949/2 "2019-07-16T01:53:53Z")

</div>

You do this by customizing your own actions. You can check out this repo on how they are using their location api

> **[GitHub - RasaHQ/medicare\_locator: 🏥Medicare Locator - Open source starter...](https://github.com/RasaHQ/medicare_locator)**
>
> 🏥Medicare Locator - Open source starter pack for developers to build contextual chatbots and AI assistants in healthcare - GitHub - RasaHQ/medicare\_locator: 🏥Medicare Locator - Open source starter ...

I could not find the tell me a joke repo but I have the code, hope this helps.

```
import logging
import requests
import json
from rasa_core_sdk import Action

logger = logging.getLogger( __name__ )

class ActionJoke(Action):
    def name(self):
        # define the name of the action which can then be included in training stories
        return "action_joke"

    def run(self, dispatcher, tracker, domain):
        # what your action should do
        request = json.loads(
            requests.get("https://api.chucknorris.io/jokes/random").text
        ) # make an api call
        joke = request["value"] # extract a joke from returned json response
        dispatcher.utter_message(joke) # send the message back to the user
        return []

```

This repo is also pretty good too~ [https://github.com/RasaHQ/rasa-demo/tree/master/demo](https://github.com/RasaHQ/rasa-demo/tree/master/demo)
