REST API‎ > ‎TalkSpaces‎ > ‎

Close TalkSpace

This method closes (removes) a TalkSpace and terminates any call segments that are in progress.

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

Path parameter:
  • conferenceid  The ID of the conference to close.
Form parameters:
  • appkey  The application key.
  • action  The action to perform - ("close")
Returns:
  • OK(200) - The conference has been closed.
  • BAD_REQUEST(400) - Missing or invalid parameter(s).
  • NOT_FOUND(404) - The conference ID is invalid.
  • BAD_GATEWAY(502) - Unable to terminate conference calls.
Response format: JSON

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

Response body:
{"ConferenceResponse":{"message":"","status":200,"conferenceId":"09c8c2994baa46949756b3d01ece44a5","uri":""}}

PHP Example

   public function stopConference($conferenceID)
    {
        $query = new telesocialQuery('conference', $conferenceID);
        $query->addApiKey();
        $query->add('action', 'close');
        if ($query->make() && $query->response['status'] == 200)
        {
            return true;
        }
        return false;
    }

Objective-C Example

/**
 This method closes (removes) a conference and terminates any call legs in progress.
 @param conferenceId    The ID of the conference to terminate.
 @see TSRestClientDelegate::restClient:didCloseConferenceId:withStatus:
 */
- (void) closeConference:(NSString*) conferenceId;

- (void) closeConference:(NSString *)conferenceId {
        [self invokeUri:[NSString stringWithFormat:@"api/rest/conference/%@", [conferenceId stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]
                         method:kBMMethodPOST
                queryParams:nil
                 postParams:[NSDictionary dictionaryWithObjectsAndKeys:
                                         self.applicationKey, @"appkey",
                                         @"close", @"action",
                                         nil]
                         target:self
                         action:@selector(closeConferenceComplete:)
                         object:conferenceId];

}