aimeos / ai-client-jsonapi

Aimeos frontend JSON API
GNU Lesser General Public License v3.0
28 stars 6 forks source link

Customer handling (create new customer and authenticate user) using API #18

Closed kumarJSS closed 2 years ago

kumarJSS commented 2 years ago

Hi,

Can you please explain how to authenticate a user and create a new customer using the API? I need to implement login and new user registration using an API in my APPs.

     

  1. I'm following the API documentation here: https://aimeos.org/docs/latest/frontend/jsonapi/customer/# create-new-customer

Where does the ajax call URL come from in JavaScript?

     

var url = result['links']['customer']['href']; // derived from the OPTIONS response

     

In the OPTIONS response, links doesn't have "customer" with "href" and I tried "self", but it is not working. Also, in "data.links.self.href" I tried, but it doesn't have a post method and it not works.

     

  1. How do I use an API to authenticate a user?
aimeos commented 2 years ago

The customer resource link is in result.meta.resource: https://aimeos.org/docs/latest/frontend/jsonapi/#retrieve-meta-data

Authentication is outside the scope of the Aimeos JSON API and you have to use Laravel Passport or Laravel Sanctum for authentication.

kumarJSS commented 2 years ago

The customer resource link is in result.meta.resource: https://aimeos.org/docs/latest/frontend/jsonapi/#retrieve-meta-data

Authentication is outside the scope of the Aimeos JSON API and you have to use Laravel Passport or Laravel Sanctum for authentication.

Thanks a lot