Message Boards
API headless-admin-user not fully enabled?
API headless-admin-user not fully enabled?
New Member Posts: 2 Join Date: 8/28/20 Recent PostsDo I have to activate those methods somehow? Any help is greatly appreciated!
RE: API headless-admin-user not fully enabled?
New Member Posts: 9 Join Date: 7/16/20 Recent PostsWrite methods will be available in the next DXP 7.3 release. They are already available in the Liferay Portal CE 7.3 GA3 release
RE: RE: API headless-admin-user not fully enabled?
Junior Member Posts: 33 Join Date: 5/19/10 Recent PostsIs it really implemented in 7.3?
Using the docker image
liferay/dxp:7.3.10-dxp-1
I try this request
POST http://localhost:8080/o/headless-admin-user/v1.0/user-accounts
Authorization: Basic test@liferay.com test
Content-Type: application/json
{
"emailAddress": "foo@example.com",
"familyName": "Bar",
"givenName": "Foo",
"x-class-name": "com.liferay.headless.admin.user.dto.v1_0.UserAccount"
}
And get
POST http://localhost:8080/o/headless-admin-user/v1.0/user-accounts
HTTP/1.1 400
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1
Set-Cookie: JSESSIONID=8F5887DA7E1C910775291489DD6E54E2; Path=/; HttpOnly
Date: Wed, 28 Apr 2021 13:48:46 GMT
Content-Type: application/json
Content-Length: 101
Connection: close
{
"status": "BAD_REQUEST",
"title": "Property \"x-class-name\" is not defined in UserAccount"
}
Response code: 400; Time: 155ms; Content length: 101 bytes
RE: API headless-admin-user not fully enabled?
New Member Posts: 2 Join Date: 8/28/20 Recent Postsis this documented somewhere? I haven't found anything...
What alternative is available to update a user, especially with custom fields?
I've only found http://localhost:8080/api/jsonws for update-user, but without custom-fields.
Best regardsChristian
RE: API headless-admin-user not fully enabled?
Liferay Legend Posts: 6403 Join Date: 9/23/08 Recent PostsI'd expect the Expando API to be used for custom fields, not the user. Expando is the API name for Custom Fields and takes the user as parameter, as it stores the extended and custom fields.
What alternative is available to update a user, especially with custom fields?
(someone correct me if I'm wrong in the context of the headless APIs)
RE: API headless-admin-user not fully enabled?
Liferay Master Posts: 978 Join Date: 1/3/10 Recent PostsRE: API headless-admin-user not fully enabled?
New Member Posts: 9 Join Date: 7/16/20 Recent PostsFor what I have researched I think that at this moment the custom fields are not editable through the API like it happens with jsonws, so your options could be using the Expando API as Olaf suggested or create a custom API that uses the Liferay services to achieve what you want
RE: API headless-admin-user not fully enabled?
Junior Member Posts: 33 Join Date: 5/19/10 Recent PostsIt seems there are other settings in Liferay that need to be configured in order to allow requests to these endpoints (CORS, authentication methods, etc). Can't find any dox though --- anyone have some links?
RE: RE: API headless-admin-user not fully enabled?
New Member Posts: 5 Join Date: 6/15/18 Recent PostsHi Kirk,
What exactly are you trying? The UserAccount
endpoints?
AFAIK, CORS is only necessary under development if you
are working with a Liferay Portal in your local machine.
Have you
tried using Liferay API Explorer? The path is http://localhost:8080/o/api.
You need to be logged in to the portal to use it, and you can check if
the endpoints work.
If not, let us know and we will be glad to
help :)
RE: RE: API headless-admin-user not fully enabled?
Junior Member Posts: 33 Join Date: 5/19/10 Recent PostsThanks Luis,
You're right, it turns out no other config was necessary. Some other issues I'm working through, but this one appears to be a non-issue.
RE: RE: API headless-admin-user not fully enabled?
New Member Posts: 5 Join Date: 6/15/18 Recent PostsGlad to help. If there is something more where we can help, let us know :)