Forum Academy Marketplace Showcase Pricing Features

Is My API Configuration OK?

I am configuring an API and haven’t done much of this yet.

My endpoint accepts text for each field.

Don’t I need to save this information as a certain thing after the endpoint is posted too?

And what if the information is being pushed to the app every two hours and is supposed to be ‘live’? Do I run a “delete all things” action in the workflow before accepting and creating the new ‘things’?

I have attached a sample output. I believe I am right by making each data type ‘text’ but not sure.

"For the leg data, the following fields are included in the post: aircraft, date, from, to, etd(utc), eta(utc), num pax, leg type, leg type carries pax

What we need from you in order to begin posting data to your service:

-Name
-URL to post legs to
-success indicator (ie: 200 or OK)"

What do you want to do with this data? If you need to save it to display in your app, then yes, add a create new Thing action and set each field to equal those keys you set up. You’ll see them as an option when you set the values. Field types should match the key types. Those parameter look like they’ll be fine as text, but make sure there aren’t numbers involved that you’ll need to do math with (if so, change to number), not sure if the date type will translate, but you can try.

Just depends on what you want to do when the data gets sent to your app. Maybe you want to make a change to a Thing with the data sent; the parameters will be available for those workflows.

Re: deleting before adding - do you mean this will be data that is frequently updating itself? Ex: Flight ETAs? Instead of deleting to create new, I’d make a change to the original thing. Perhaps there’s a unique ID parameter that doesn’t change that you could use to locate the Thing to change. And have “create if it doesn’t exist” checked.

2 Likes

Would this information normally expire? such as in when a particular flight (leg) takes off?

Yes, that’s correct, so all flight data is pushed to the app every 2 hours and includes aircraft availability etc. so it should really be real-time.

My concern is if I make changes to thing, won’t it keep the things inside the database that don’t need changing? This is why I felt it should delete all things and create new things all together.

I’ll test it all with text today and see if I can get a call received and working.

So every two hours, some of the Things in your database need to be updated?

1 Like

Not necessarily updated in my view. I would think more as removed or added hence why I feel it may need to clear the database first, and then create new things second. Flights added or removed based on whether or not they’ve departed yet.

Oh ok, so if something isn’t changed, then it should be removed. Got it. You could create another action to delete a list of existing events whose IDs (or some identifying field/parameter) is not found in the update. But yeah, give it a test and see what flows will work best for this.

Do the departure or arrival times correspond to the update time? You don’t need to accomplish everything in one workflow. If you set a workflow to look for data updates based on the last time a flight was checked, you’ll know if you’re dealing with a change in your Things. Create two calls. One for updating Things, and one for testing time. This may not be the most efficient way to do this depending on the other types of calls involved.

This may be what @romanmg just said.

This topic was automatically closed after 70 days. New replies are no longer allowed.