How To Build an Experience API - Newbie problem?

Hello,

I’m trying to follow this tutorial, but it looks like the initial section is missing:

How To Build an Experience API | Losant Documentation

The photos in the tutorial show a login page, but the tutorial jumps right into the user registration page construction.

I created a simple login page and pointed it to /auth since when I pointed it to /users and logged in, the response was always “Email already exists.”.

If I put in credentials to create a new user, I get a json response which includes the new token printed on my screen.

My confusion is how I get from /auth to the /devices endpoint.

In my application, each login will be hardcoded via tags to a single device. SO if the user logs in and passes authentication, they should be redirected to /devices/{id}/data where they will see the last states for their device.

Thank you,
John

I switched and used portions of the Huddle Application and now I am able to login and view one of my dashboards.

I’ll probably need a few hints on how to setup a page to display my device states - I assume I create an experience workflow to gate the states (Device Get) and then i create a page that formats the results?

Thank you,
John

Hey @John_Hart,

We recently released the Connected Product Foundation (CPF), which is a much more complete starting template for new applications. It delivers a ton of this capability out of the box. Since it sounds like you’re starting from scratch, I would definitely recommend trying it out.

We also have a Deeper Dive Webinar replay that covers the CPF.

@Brandon_Cannaday when I try to add the CPF it says I don’t have enough resources available. I don’t have enough workflow and experience pages remaining.

Is it possible to backup my entire experience so I can restore everything (including data) if I run into problems while I rebuild everything using CPF?

The only way I saw was to do individual backups.

Thank you,
John

There is not an easy way to restore device data. You can backup all other application resources using application export:

https://docs.losant.com/applications/import-export/#exporting-an-application

You can then delete just the experience resources and import the CPF into your existing application:

https://docs.losant.com/experiences/overview/#deleting-experience-resources

Here’s a zip of the CPF with the devices and non-experience workflows removed. You can import this into your current application:

export-65d76fed07e33416b819da2e-1708617930597-cpfExport.zip (466.9 KB)

https://docs.losant.com/applications/import-export/#import-into-an-existing-application

If you want to restore what you originally had, you can delete all experience resources again and import the previous application export and choose just to import just the experience resources.

Hello @Brandon_Cannaday!

Will the CPF solve Losant’s problem with time zones?
Our customers need graphs counting data per day.
But there are errors in the bar chart data in Losant when we select a 24h resolution.
This resolution only provides correct data for countries located in GMT-0.
see our July 2023 post.

The CPF does not directly help this issue. The built-in bucketing is performed directly in the time-series database for performance reasons and we do not yet support the ability to pass in custom timezones. This is something we’ve been investigating for a while.