I want users of my app to access the data they have created in Bubble on their own web site, via JSON. Hence I want to expose various data types via the API, based on their own user login credentials that are embedded in the GET url.
Some things I have worked out:
In settings, I’ve enabled “This app exposes a data API”. I’ve selected the types to expose.
I’ve accessed the JSON for those types via the “…api/1.1/obj/type_name” path.
A good start.
Two questions remain.
1) Use of Endpoints
I believe I can access more qualified data by creating an API End Point within the API Workflows section.
I’ve tried that, (see setup below) and I am accessing it with the url:
But I’m getting a “type not found” message.
Should the URL be different when I’m accessing an endpoint rather than a type?
2) Login API
Since my site will have mulitple users, I need the API to perform a login process. The reference manual discusses this, but the words make no sense to me!
Can someone advise me the specific steps to take to set up the URL so that a user login is performed?
Many thanks in anticipation,
Reference Manual on Login Authorisation
Create Sign up/Login API workflows. This is useful for building an alternative front-end to the Bubble app, such as a native app that you developed. When an API workflow contains a sign up or login action, then a user ID, token, and expiration, expressed in seconds, are returned with the response of the call. Subsequent calls to the app’s API, with a header Authorization: Bearer API_TOKEN, runs all calls and workflows in the context of the user associated with the token. This user will be the ‘Current user,’ who you can access with actions. Privacy rules will apply to this user as they would if the user was logging in the Bubble app and using it in their own browser. This token should be kept safe.