Open mhd999 opened 7 years ago
Hi mhd999!
See the following steps to create an admin user through the API. With it, you don't need a token, but just a clientID/clientSecret.
(see https://beaconcontrol.io/dev/backend/s2s_api_docs_v1/index.html)
To get client_id and client_secret execute one of the following commands: SQL:
select uid, secret from oauth_applications where owner_type = 'Brand';
rails console:Doorkeeper::Application.where(owner_type: 'Brand').select(:uid, :secret).first
(see https://beaconcontrol.io/dev/backend/s2s_api_docs_v1/registration.html)
URL: e.g. http://server:port/s2s_api/v1/admins Request Body:
{
"client_id": "your-client-id",
"client_secret":"your-client-secret",
"admin": {
"email": "new-admin@example.com",
"password": "new-pw"
}
You could now go ahead and create a Token for this new user. Hope this helps you or any other ppl who stumble upon this!
Hi!
Am trying to use the s2s api to create applications for now, As i understood from the docs we need access_token to authenticate the request which it can be fetched from this api
/s2s_api/v1/oauth/token
however i need to create the user using the UI first and wondering if this can be done through the api.