Question Meenakshi Muthu · 7 hr ago

SCIM Rest API using cache class

Hi all,

I am in need to use SCIM rest Api in cache class, could you please pour me some samples to use SCIM.

Actually, I need to form the JSON request for SCIM request for User Provision.

Could you please help me on this? 

Thanks in advance,

Meenakshi M

Comments

Julian Matthews · 4 hr ago

Hey Meenakshi.

I would say that for your ask regarding the JSON request, you'll want to start with using the JSON Adapter to create the class that you can populate with the user information before using the JSON Adapter methods to output to JSON as part of an operation to communicate with the rest endpoint you are looking to provision the users on.

Using the JSON Adaptor | Using JSON | InterSystems IRIS Data Platform 2026.1

Set up a class similar to the examples in the above link but for what you need for the user provision

Class Demo.Messages.SCIM.User.Core Extends (%Persistent, %JSON.Adaptor) 

Property schemas As %DynamicArray; 

Property userName As %String; 

Property active As %Boolean; 

Property name As Demo.Messages.SCIM.User.name; 

//Etc etc

And then in your operation for sending the JSON to the endpoint, you can do something along the lines of:

// code before
        Set webrequest = ##class(%Net.HttpRequest).%New() 
   		#DIM webresponse As %Net.HttpResponse 
	    Do webrequest.SetHeader("Content-Type","application/json") 
        Do webrequest.EntityBody.Write(pRequest.%JSONExport()) 
// code after

But, with a lot more padding, error handling, and checking of the response back to make sure it's done what you've needed and returned things like the id for the created user and the meta data etc.

0