JSON API » patternmenus » patternmenus/patterns/create

Creates a new pattern.

Input parameters

Requires authentication and the user role privilege.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
patternmenuIntegerID of pattern menu.Yes
dtypeStringDestination type.Yes
dnumberStringDestination number.Yes
cnumberStringThe called number to match. Empty string for any.NoEmpty string.
descriptionStringDescription.NoEmpty string.
digitsStringDigits entered by caller to match. Empty string for any.NoEmpty string.
priorityIntegerPriority from 1 to 10.No1
snumberStringCalling number to match. Empty string for any.NoEmpty string.
typeStringType of match. "contains", "exact", or "regular_expression".No"exact"
validationInteger1 to validate input then return, 0 for full action.No0

Responses

CodeDescription
200Success.
201Input passed validation. Only returned if validation=1.
400Invalid input parameters specified. Check the key and message fields for more details.
401The authentication details provided are invalid.
402Your role does not allow this.
403Your rate plan does not allow this.
404The pattern menu does not exist, or you do not have permission to view it.

Data returned

The ID of the created pattern.

Example: With callerid

http://enswitch.example.com/api/json/patternmenus/patterns/create/?auth_username=user;auth_password=password;patternmenu=123;dtype=phone;dnumber=1234567;snumber=2125551234

{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":{ "id":123 } }

Change history

VersionChanges
3.13Function added.