Hi,
I’m modifying the react code base for admin delete extension and as part of feature letting users add members to any given group. I’m following this api:
I’m correctly passing the Token and other payload info, however, when I use the Axios or Node request both calls is resulting in error, please see the following example:
var request = require("request");
var options = { method: 'PATCH',
url: 'https://opensimspoc.us8.webtask.io/{guid}/api/groups/{group_id}/members',
headers: { authorization: 'Bearer token,
data: [ "id1", "id2" ] }
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
This is given me error “value must be array”.
If you guys can point me to a example of how to correctly call this api and pass user(S) to any given group to be added.
Please see this thread similar issue faced by other user:
Yes I confirm, missing quote is not the issue, you can try calling this end point from any external client no matter how I try add member to group or adding single member to multiple groups both fails. I’ve granted full access in my machine to machine client. Surprising, I can read and even remove user from group but not allowing to add.
Can you add the member to the group in the dashboard? You can view the request there if you use Chromes Network dev tool. The extension dashboard is built off of the API, so if you can do it there you should be able to do it via a patch request.
Also, I would like to confirm you are including the user id correctly. It should be in this format ["auth0|4rg6715b584db630dc44ada27"]
Hi Dan,
Thanks for the response. Yes, we are able to add and remove users from group using the Dashboard. But we dont want to give dashbaord access rights to certain users, that is why we are building the custom UI. Here is a test i am doing using Nodejs, and see i am crrectly sending the data :
request(options, function (error, response, body) {
if (error)
throw new Error(error);
console.log(body);
});
If you require the client id and secret to test it on your side, we would be happy to provide. In meanwhile can you do a test on your side using NODE or any other JS client to see if your PATCH api call works outside of dashboard?