GraphQL: is it possible to "mutate" an extension's user name

Hello,

I would appreciate the ability to change one extension’s user name using FreePBX GraphQL or REST API.
Is it possible to do this ?
Doc [1] does not mention this possibility.

[1] https://wiki.freepbx.org/display/FPG/API

Best regards

Most of the GraphQL documentation can be found inside the FreePBX App. You can find out more about the GraphQL support in FreePBX here: GraphQL support in FreePBX 15 | FreePBX - Let Freedom Ring

Unfortunately, I don’t think there is a way to update the extensions’s user name. The GraphQL library is only about 20% complete and the rest library is in the same state it seems. The userman module, where the users live, don’t look to have a GraphQL API. It DOES have a Rest API, but it looks to be read only.

The semi-good news is that device mutation look to be supported by the GraphQL library. I did pull up the code where the device is updated, but it looks like it just removes the device and creates a new one: Source of Devices.php - core - FreePBX GIT

I will note that a device and a user in FreePBX are two different objects.

Some of the queries I played around with were:

And the Update query, but it looks to have a bug in it:

1 Like

Note the GraphQL and REST API are very basic. They have a ton of room for expansion. I encourage people to contribute to these and add support to more modules.

Thanks for replying !

Just a question:
Is the above id: “6060” instead of id: “6000”, on purpose ?

That’s probably the bug…

Thinking back to what I was hoping to implement:

  • a userman module API (either GraphQL or REST) is needed
  • this API should allow INSERTs and UPDATEs.

Maybe, an LDAP backend can act as such, giving me the capability to create new users or edit existing ones and then “moving” an existing extension from one user to a new one …

Yeah, I agree it would be nice. I’m not sure when a developer at Sangoma will get the priority to add this functionality, but maybe someone from the community can help out here. And if anyone does have an interest in doing so, I would love to talk to them.

User Manager already has all of this without an API.

You can obviously create User entries in LDAP database.

My question is:
Using GraphQL or REST, can you currently dissociate one Extension from one LDAP User entry and associate it to another LDAP User ?

Being really novice in LDAP matters, I’m certain I would dive in many traps before finding a meaningful answer while building a prototype to test this.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.