REST API‎ > ‎TalkSpaces‎ > ‎

Hang Up

This method terminates the specified TalkSpace participant. 

Method: POST 
URI: /api/rest/conference/{conferenceid}/{networkid}

Path parameters: 
  • conferenceid  The conference ID of the call.
  • networkid  The network ID to terminate from the call.
Form parameters: 
  • appkey  The application key 
  • action  The action to perform - ("hangup")
Returns: 
  • OK(200) - The call leg has been closed. 
  • BAD_REQUEST(400) - Missing or invalid parameter(s). 
  • UNAUTHORIZED(401) - The specified network ID is not associated with the application identified by the application key. 
  • NOT_FOUND(404) - The conference ID is invalid. 
  • BAD_GATEWAY(502) - Unable to terminate call at this time. 
Response format: JSON 

Example using curl


curl -d "appkey=1f1bbca5-b71f-4938-97b6-59fed80623bc&action=hangup" https://api.telesocial.com/api/rest/conference/09c8c2994baa46949756b3d01ece44a5/1002198422/hangup 


Response body
 

{"ConferenceResponse":{"message":"terminated","status":200,"conferenceId":"63c9b03b84e9476080f7afe9ac2aa58e","uri":"\/api\/rest\/conference\/63c9b03b84e9476080f7afe9ac2aa58e"}}

Objective-C Example

- (void) hangupNetwork:(NSString *)networkId inConference:(NSString *)conferenceId {
        [self invokeUri:[NSString stringWithFormat:@"api/rest/conference/%@/%@", [conferenceId stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
                                         [networkId stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]
                         method:kBMMethodPOST
                queryParams:nil
                 postParams:[NSDictionary dictionaryWithObjectsAndKeys:
                                         self.applicationKey, @"appkey",
                                         @"hangul", @"action",
                                         nil]
                         target:self
                         action:@selector(hangupNetworkInConferenceComplete:)
                         object:[NSArray arrayWithObjects: networkId, conferenceId, nil]];
}

JAVA Example

 public void hangup(HasNetworkId networkInfo) throws BadRequestException,
            BadGatewayException, ResourceNotFoundException,
            AuthorizationException {
        UrlBuilder urlBuilder = urlBuilderFactory.get()
                .addPathSegment("conference")
                .addPathSegment(conference.getConferenceId())
                .addPathSegment(networkInfo.getNetworkId())
                .addPostParameter("action","hangup");
        URL url = urlBuilder.create();
        ConnectionUtil.doPost(url, conference.getConferenceId(),
                urlBuilder.getPostContents());

    }