Evo Voice

<back to all web services

NewOutgoingSession

Create a new outgoing call and process it with the specified flow. This can only be used for voice sessions. If no caller ID is specified, we will use a random one.

Requires Authentication
Requires any of the roles:Manager, SystemAdministrator
The following routes are available for this service:
POST/sessions/outgoing
import 'package:servicestack/servicestack.dart';

/**
* Create a new outgoing call and process it with the specified flow. This can only be used for voice sessions. If no caller ID is specified, we will use a random one.
*/
// @Api(Description="Create a new outgoing call and process it with the specified flow. This can only be used for voice sessions. If no caller ID is specified, we will use a random one.")
class NewOutgoingSession implements IPost, IConvertible
{
    /**
    * The ID of the flow to use. This flow will be executed as soon as the call is answered.
    */
    // @ApiMember(Description="The ID of the flow to use. This flow will be executed as soon as the call is answered.")
    String? flowId;

    /**
    * The E164 number to dial, e.g. +18144043093
    */
    // @ApiMember(Description="The E164 number to dial, e.g. +18144043093")
    String? numberToDial;

    /**
    * The Caller ID to use. This must be the E164 number of an owned phone number
    */
    // @ApiMember(Description="The Caller ID to use. This must be the E164 number of an owned phone number")
    String? callerId;

    NewOutgoingSession({this.flowId,this.numberToDial,this.callerId});
    NewOutgoingSession.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        flowId = json['flowId'];
        numberToDial = json['numberToDial'];
        callerId = json['callerId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'flowId': flowId,
        'numberToDial': numberToDial,
        'callerId': callerId
    };

    getTypeName() => "NewOutgoingSession";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'evovoice.io', types: <String, TypeInfo> {
    'NewOutgoingSession': TypeInfo(TypeOf.Class, create:() => NewOutgoingSession()),
});

Dart NewOutgoingSession DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /sessions/outgoing HTTP/1.1 
Host: evovoice.io 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"flowId":"String","numberToDial":"String","callerId":"String"}