Comments (4)
Hi @MichaelSowah, the API supports registration with an email, username and password.
WPUserRegisterResponse wpUserRegisterResponse = await WPJsonAPI.instance
.api((request) => request.wpRegister(
email: email,
password: password,
username: username
));
Once they are logged in, you could then call the API to update the user's phone number.
If it's the 'billing phone number' field, you could use the below API method or shippingPhone
for the 'shipping phone number'.
WCCustomerUpdatedResponse wcCustomerUpdatedResponse = await WPJsonAPI.instance
.api((request) => request.wcUpdateCustomerInfo(
userToken,
billingPhone: billingPhone
));
Re. the role, the API currently doesn't support that.
We can add it to the backlog of things to do, might have a quick turnaround on this for you.
from wp-json-api-flutter.
Thanks, I would really appreciate that especially the ability to pass the role of the user eg: customer, admin, etc.
At least an optional parameter/field for the dev to pass the user role will be very great for me please as I have different users with different roles creating accounts on my app...how possible is this and what's likely the timeline for adding the role parameter/field?
from wp-json-api-flutter.
Hi @MichaelSowah, v3.1.2 supports the ability to add/remove roles.
Add a new role to a user
WPUserAddRoleResponse wpUserAddRoleResponse = await WPJsonAPI.instance
.api((request) => request.wpUserAddRole(
userToken,
role: "customer" // e.g. customer, subscriber
));
Remove role from a user
WPUserRemoveRoleResponse wpUserRemoveRoleResponse = await WPJsonAPI.instance
.api((request) => request.wpUserRemoveRole(
userToken,
role: "customer" // e.g. customer, subscriber
));
You'll need to update your WordPress plugin WP JSON API to v3.1.0
.
from wp-json-api-flutter.
great, I updated my plugin
from wp-json-api-flutter.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wp-json-api-flutter.