I am developing a custom application in Angular, based on @c8y/websdk’s application, to then incorporate it into my cumulocity platform, on said angular application I have made a form to create a new user with certain specific parameters, but at the same time I need specify certain inventory role privileges to a specific group. So my problem is that I cannot find the appropriate documentation to update the groups and inventory role privileges to be associated. Is there a websdk service of type inventoryRoles.update()?
I have tried to perform the update through fetch()… but it asks me for credentials to perform this action.
How could I perform this action without passing on credentials or taking them from the logged in user?
If you want to perform requests using fetch against your tenant with the corresponding credentials, you can use the fetch method provided by the FetchClient.
using, UserInventoryRoleService, gives me these Error:
Uncaught (in promise): NullInjectorError: R3InjectorError(AppModule)[UserInventoryRoleService → UserInventoryRoleService]:,
Reminding you that I’m building an angular application using @c8y/websdk,
on the other hand using fetch, when making the POST call, it gives me a 401(Unauthorized)
And as said before if you want to access some endpoint that might not be covered by the @c8y/client package, you can dependency inject the FetchClient and use it’s fetch method. Using the fetch method provided by the FetchClient will take care of adding the required headers for authorization. If you are using the global fetch function instead, these headers will be missing.
In case you are having further issues, please provide code snippets and the version of the c8y packages you are using.
Are you developing an app or a plugin?
Are you calling CoreModule.forRoot() in more than one place? In which locations are you calling CoreModule.forRoot()?
Feel free to upload a minimal sample that reproduces your issue to some external service.
You can send the link to that sample directly via a personal message to me.