Skip to end of metadata
Go to start of metadata


The simplest way is to use an external connector, as those services are highly developed and integrate well with Mobsted.


On Mobsted side all is done using a standard 3 step REST API approach - Provider (where is data, Step 3 below) →  Method (how is data managed, Step 4 below) → Operation (actual data change, Step 5 below)


As an example, we will use the APIspreadsheets.com  www.apispreadsheets.com


Step 1 is - connect a table in your Google sheets to the  www.apispreadsheets.com. Use their instruction on how to upload/connect a file. 


As a result we get a connected table. 



Step 2 - Select a needed type of request, for example Create or Delete:

The instruction of the apispreadsheets.com service has other examples:



Step 3  - create an API provider on the Mobsted Platform


API Providers - Add API Provider

Fill in a name and endpoint address for the new provider


Api Provider name - any name convenient for you

Base URL - fill in with the part of the address received as API URL at https://www.apispreadsheets.com/

Press SAVE



In the example Base URL has the address and ID of a table. All methods for this API provider will only work in the particular table to which the provider points, if set as a constant.

You can also use one and the same API provider with just the URL of the service for all your tables, just make sure you add a table's ID for each case to point to a specific table. You can send this table's ID using a variable. 


Example: 




Step 4 - create a method for the API provider


The example below explains how to delete a row from a table. All other operations are similar in setup.


We took a GET method and filled it in

 

Please note that the API url needs to be divided in two - between Endpoint URL  and the actual data in the "?query=" part.


For example, we want to delete a line/row with Order = 0013604


Save the new Method


NOTE that column name, values and operators (= > < etc) can be transferred as variables from your app. 



Add authentication keys:



NOTE - this example uses access without authentication keys (the URL is hashed, which provides some security), so when creating keys just leave empty fields in Key1, Key2, Key3


Save the key



Step 5 - create a new operation that can be used in your applications

Go to API Operations

 

Add a new operation


Select a method we just added in API Providers, and the needed key in API Keys (when you have those)



Go to the Constructor tab of the platform

Add a button and Add New Action to the button - EXECUTE OPERATIONS:


Pick the right operation in your list, we just created something named APISPEAD:


Save the Action


Save screen changes



Open the app as a user and press the button to delete a row:



Check back the table - the line was deleted:




It is always a good practice to check the result using the network tab of the browser (inspect - network - execute)

There you can see all results of all executed operations and/or ERORRS which are very important for you to find where you made a mistake with an operation . 


ERROR Example: Wrong name of a table in API Provider:


ERROR Example: A line/row to be deleted does not exist:





As always, get back to us with any questions you have at [email protected] or in our online chat. 

  • No labels