> For the complete documentation index, see [llms.txt](https://mobsted-2.gitbook.io/knowledge-base/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mobsted-2.gitbook.io/knowledge-base/basics/introduction/chaining_api_calls.md).

# Chaining API calls

In [previous example](/knowledge-base/basics/introduction/use_any_internal_and_external_api.md) we used API call to third party service to check weather in the city. Now we extend it by passing the data to the next API call. We will use next API call to save the weather data into internal platform storage - column **LastCityTemperature** in Objects.

Steps to take:

{% hint style="info" %}
Make sure you have accomplished the steps described in [Use any external & internal API ](/knowledge-base/basics/introduction/use_any_internal_and_external_api.md)article before implementing the steps below.
{% endhint %}

1. CREATE API OPERATION FROM MOBSTED API
2. PASS THE PARAMETERS INTO THE API OPERATION
3. CREATE USER VIEW
4. CHECK RESULT

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

**CREATE API OPERATION FROM MOBSTED API**

1. Navigate to **MY PROFILE** section in the top right corner![](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/6vuz0emhjg/1557735264977/image.png)
2. Go to **Keys** tab
3. Copy **Primary** and **Secondary Ke**y to your favorite note app
4. Navigate to **API Providers** section in the left hand side menu and click **Add API Provider**
5. Fill in:
   * **Name**: *Mobsted 1*
   * **Base URL**: *<https://demoapp-admin.mobsted.com>*
6. Click **Save** **API Provider** and then click **Create New API Provider Method**
7. Name the fields:
   * **Api Provider Method Name**: *Weather to Column Method 1*
   * **Method**: *PUT*
   * **Endpoint URL**: */api/v8/object/#Object:id#*
   * **Consumes Type**: *application/x-www-form-urlencoded*
   * **Produces Type**: *application/json*
8. Click **Add Parameter** at the bottom of the pop up and fill in the fields:
   * **Name**: *applicationId*
   * **In**: *query*
   * **Type**: *Integer*
   * **Description**: *Application ID*
   * Check the box **Required**
   * Click **Save Parameter**
9. Click **Add Parameter** again and fill in the fields:
   1. **Name**: *LastCityTemperature*
   2. **In**: *query*
   3. **Type**: *String*
   4. **Description**: *Last City Temperature*
   5. Check the box **Required**
   6. Click **Save** **Parameter** and then **Save API Provider Method**
   7. Click **Close**\
      **NOTE:** the name of this parameter **must** match the name of your column that will store the temperature (LastCityTemperature)
10. Go to **API KEYS** tab and click **Create New API Key**
11. On **API Key - Create** page fill in the fields:
    * **Api Key Name**: *Mobsted Key*
    * **Method**: *Basic*
    * For **Key1 and Key2**: copy-paste the keys you've copied on step **1-с**
12. Click **Save** and then **Close**.

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

**PASS PARAMETERS INTO API OPERATION**

1. Click **Operations** in the left hand side menu
2. Click **Add Operation**
3. Open **Mobsted** **1** drop down on the left, select **Weather to Column Method 1** that we created on the previous step
4. Fill in the field: **Operation Name**: *Weather to Column Operation 1*
5. In the **EXECUTION** section fill in the parameters:
   1. **API Key**: *Mobsted Key*
   2. **applicationId**: 1
   3. **LastCityTemperature**: *#Variable:varTemp#*
6. Click **Save Operation.**

![](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/6vuz0emhjg/1557738280259/image.png)

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

**CREATE USER VIEW**

1. Navigate to **Constructor** to the screen created with [previous steps](https://kb.mobsted.com/article/xy951dk783-send-and-receive-your-data-via-external-api-integrations)
2. Select button **Check #Backendname:city#** and click **Actions,** and then **Add new Action**
3. From the drop down select **Set Variable**, click **Add item** and fill in:
   * **Name**: *varTemp*
   * **Value**: #Backendname:city# : #Operation:weather Operation:Response:Result\[0]:current.temp\_c#
4. &#x20;Click **Save**

![](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/6vuz0emhjg/1557739354793/image.png)

1. Click **Add action**, select **Execute Operations** from the first drop down and select **Weather to Column Operation 1**
2. Click **Save**
3. Drag and Drop [Text](/knowledge-base/references/intro-placeholder/constructor_elements.md#text) element under the element where we display the current temperature, fill in it's properties:
   1. **Backendname:** *LastCity*
   2. **Text:** *Last Check: #Object:LastCityTemperature#*
4. Click **Add Conditions** in **Visibility** block in the **Properties**
5. Fill in the first field in **Hide conditions** with: *#Object:LastCityTemperature#*![](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/6vuz0emhjg/1560139970989/image.png)
6. Click **Save screen**.

**\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_**

**CHECK RESULT**

\
Click **Preview** button to launch the app from the current screen to check it works.

![](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/6vuz0emhjg/1560140241889/image.png)

{% hint style="info" %}
You can check the set up described on screen - **14** **Chaining Internal API** in **Demo App** in your profile.
{% endhint %}

####

#### MENTIONED ARTICLES

* [Constructor elements](/knowledge-base/references/intro-placeholder/constructor_elements.md)
* [Use any external & internal API](/knowledge-base/basics/introduction/use_any_internal_and_external_api.md)

####

#### RECOMMENDED ARTICLES

* [Automate with triggers](/knowledge-base/basics/introduction/automate_with_triggers.md)
* [Hashtags](/knowledge-base/references/intro-placeholder/hashtags.md)
