Method description


createMemberships is the method to add one or more sets of persons as members of one or more groups.

Preconditions for use

You will need to know the syncID of the groups and the syncID of the persons who should be members of the groups

Message Schema

Input parameters / request message elements

Name

Description

Data type

Allowed values

M/O

<membershipIdPairSet>

Wrapper for a list of <membershipIdPair> elements



M

<membershipIdPair>

Wrapper for a set of one <sourcedId><identifier> element and one <membership> element.



M

<sourcedId><identifier>

A unique identifier for this set of group / person mappings

Text

Max 255 characters

M

<membership>

Wrapper element for one <groupSourcedId ><identifier> element and one <member> elements



M

<membership><groupSourcedId ><identifier>

The syncID for the group that will have a member

Text

M

<membership><member><memberSourcedId ><identifier>

The syncID for the person to add as a member

Text


M

Please refer to the WSDL for the full element structure, only key elements are described here

Response message elements


Name

Description

Data type

createMembershipsResponse

Empty response element

Empty

Comments

For each <membershipIdPair><sourcedId><identifier> in the request you will get a status in the <statusinfoSet><status> in the response.
The order of the <statusInfoset><status> corresponds to the the order of the <membershipIdPair><sourcedId><identifier> in the request.


Example

Description

I have a group C with syncID = G2 in itslearning
I have a persons B with syncID =99998888 itslearning.
I want the person B to become a member of hierarchy group C in itslearning. Role in hierarchy should be teacher.

I have a group D with syncID = G3 in itslearning
I have a persons B with syncID = 99998888 itslearning.
I want the person B become a member of hierarchy group D in itslearning. Role in hierarchy should be student.

Example request message

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ims="http://www.imsglobal.org/services/common/imsMessBindSchema_v1p0" xmlns:ims1="http://www.imsglobal.org/services/mms/xsd/imsMemberManMessSchema_v1p0" xmlns:ims2="http://www.imsglobal.org/services/common/imsCommonSchema_v1p0" xmlns:ims3="http://www.imsglobal.org/services/mms/xsd/imsMemberManDataSchema_v1p0">
<soapenv:Header>
<ims:syncRequestHeaderInfo>
<ims:messageIdentifier>1</ims:messageIdentifier>
</ims:syncRequestHeaderInfo>
</soapenv:Header>
<soapenv:Body>
<ims1:createMembershipsRequest>
<ims1:membershipIdPairSet>
<ims1:membershipIdPair>
<ims1:sourcedId>
<ims2:identifier>M2</ims2:identifier>
</ims1:sourcedId>
<ims1:membership>
<ims3:groupSourcedId>
<ims2:identifier>G2</ims2:identifier>
</ims3:groupSourcedId>
<ims3:member>
<ims3:memberSourcedId>
<ims2:identifier>99998888</ims2:identifier>
</ims3:memberSourcedId>
<ims3:role>
<ims3:roleType>02</ims3:roleType>
</ims3:role>
</ims3:member>
</ims1:membership>
</ims1:membershipIdPair>
<ims1:membershipIdPair>
<ims1:sourcedId>
<ims2:identifier>M3</ims2:identifier>
</ims1:sourcedId>
<ims1:membership>
<ims3:groupSourcedId>
<ims2:identifier>G3</ims2:identifier>
</ims3:groupSourcedId>
<ims3:member>
<ims3:memberSourcedId>
<ims2:identifier>99998888</ims2:identifier>
</ims3:memberSourcedId>
<ims3:role>
<ims3:roleType>01</ims3:roleType>
</ims3:role>
</ims3:member>
</ims1:membership>
</ims1:membershipIdPair>
</ims1:membershipIdPairSet>
</ims1:createMembershipsRequest>
</soapenv:Body>
</soapenv:Envelope>


Example response message

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:syncResponseHeaderInfo>
<messageIdentifier>1</messageIdentifier>
<statusInfoSet>
<statusInfo>
<codeMajor>success</codeMajor>
<severity>warning</severity>
<codeMinor>
<codeMinorField>
<codeMinorName>membershipmanagement</codeMinorName>
<codeMinorValue>idalreadyinuseupdateinstead</codeMinorValue>
</codeMinorField>
</codeMinor>
<messageIdRef>1</messageIdRef>
<description>
<language>en-US</language>
<text>Object exists, has been updated instead</text>
</description>
</statusInfo>
<statusInfo>
<codeMajor>success</codeMajor>
<severity>warning</severity>
<codeMinor>
<codeMinorField>
<codeMinorName>membershipmanagement</codeMinorName>
<codeMinorValue>idalreadyinuseupdateinstead</codeMinorValue>
</codeMinorField>
</codeMinor>
<messageIdRef>1</messageIdRef>
<description>
<language>en-US</language>
<text>Object exists, has been updated instead</text>
</description>
</statusInfo>
</statusInfoSet>
</h:syncResponseHeaderInfo>
<o:Security s:mustUnderstand="1">
<u:Timestamp u:Id="_0">
<u:Created>2011-02-03T14:55:31.250Z</u:Created>
<u:Expires>2011-02-03T15:00:31.250Z</u:Expires>
</u:Timestamp>
</o:Security>
</s:Header>
<s:Body>
<createMembershipsResponse/>
</s:Body>
</s:Envelope>