Overview
This method returns an existing group
Syntax
C#
[OperationContractAttribute()] SBT.API.DataContracts.Admin.WSGroupResponse ReadGroup( string securityToken, string orgCode )
WSDL
Production: https://ui.solutionsbytext.com/Sbt.App.SetUp/WSServices/GroupWSService.svc?singlewsdl
Staging: https://test.solutionsbytext.com/Sbt.App.SetUp/WSServices/GroupWSService.svc?singlewsdl
Parameters
securityToken
- String[1000] (Required) - SecurityToken to authenticate the user.
orgCode
- String[20] (Required) - Default Code for group to be read (Only Group code is accepted).
Return Value
WSGroupResponse
Name | Type | Description |
---|---|---|
Result | bool | True/False whether the call was successful or not. |
ErrorCode | int | For Success/Failure it returns an error number. |
Message | string | Message related to the error code. |
Response | GroupDetail | GroupDetail object. * DefaultCode – Defaultcode (Organization Code) for the group. * IsPublic - 1 = public, 0 = not public. * OrgCode - New Organization Code for the group (group). * Name - Name of the group (group). * Order - Order that it will show up in the organization tree. |
Examples
C#
GroupClient groupService = new GroupClient("GroupWSServiceHttpEndpoint"); string securityToken = txtToken.Text ; string orgCode = txtOrgCode.Text; // create binding WSGroupResponse wSGroupResponse = groupService.ReadGroup(securityToken, orgCode); //process response if (!wSGroupResponse.Result) { //handle error lblError.Text = wSGroupResponse.Message; } else { //handle success lblError.Text = wSGroupResponse.Message; }
SOAP
Soap Request <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://SBTService/ServiceContracts/"> <soapenv:Header/> <soapenv:Body> <ser:ReadGroup> <!--Required:--> <ser:securityToken>Security Token</ser:securityToken> <!--Required:--> <ser:orgCode>Group Code</ser:orgCode> </ser:ReadGroup> </soapenv:Body> </soapenv:Envelope> Soap Response <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <ReadGroupResponse xmlns="http://SBTService/ServiceContracts/"> <ReadGroupResult z:Id="i1" xmlns:a="http://SBTAPIService/DataContract/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/"> <a:Result>true</a:Result> <a:ErrorCode>1256</a:ErrorCode> <a:Message>Group found</a:Message> <a:Response z:Id="i2"> <a:Name>Group1</a:Name> <a:IsPublic>1</a:IsPublic> <a:Order>2</a:Order> <a:DefaultCode>Org Code</a:DefaultCode> </a:Response> </ReadGroupResult> </ReadGroupResponse> </s:Body> </s:Envelope>
JAVA
GroupWSService srv = new GroupWSService(); IGroup iGroup = srv.getGroupWSServiceHttpEndpoint1(); WSGroupResponse res = null; String securityToken = "securityToken"; String orgCode = "orgCode"; try { res = iGroup.readGroup(securityToken, orgCode); } catch (Throwable e) { e.printStackTrace(); } if<(res == null ){ System.out.println("::Erron::"); return; } if (res.isResult() == null || !res.isResult()) { //handle error System.out.println("ErrorCode::"+res.getErrorCode()); System.out.println("ErrorMessage::"+res.getMessage().getValue()); } else { //handle success System.out.println("ID::"+res.getId()); System.out.println("Message::"+res.getMessage().getValue()); }
PHP
<?php $client = new SoapClient("https://ui.solutionsbytext.com/Sbt.App.SetUp/wsservices/GroupWSService.svc?wsdl"); $param = array( 'securityToken' =--> 'securityToken', 'orgCode' => 'orgCode' ); $response = $client->__soapCall('ReadGroup', array($param)); echo '<pre?>'; print_r($response); if($response->ReadGroupResult->Result){ echo 'Message: '.$response->ReadGroupResult->Message; } else { echo 'Message: '.$response->ReadGroupResult->Message; } ?>
REST
Method: GET
Response:
The response will be in JSON format like below: {" ReadGroupResult": { "Result": true, "ErrorCode": 1256, "Message": " Group Found", “Response”: { “GroupDetail response – Keyword Information will display” } }}