Backup

Start backup process

GET /api/v1/tenants/(string: tenant_id)/groups/(string: group_id)/batch/backup/start/

Starts the backup process for the current Group settings.

Example request:

GET /api/v1/tenants/foo/groups/foogroup/batch/backup/start/ HTTP/1.1
Host: example.com

{
   "group": [
      "profile",
      "ivr",
      "call_center",
      "music_on_hold",
      "phone_book",
      "call_pickup",
      "announcements",
      "time_schedule",
      "calendar_schedule",
      "access_devices",
      "fax_messaging",
      "main_schedule",
      "time_based_forwarding"
   ],
   "user": [
      "profile",
      "phone_book",
      "announcements",
      "services",
      "voice_mail"
   ],
   "formats": [
      "xml",
      "json"
   ],
   "download_announcement_files": true,
   "force_backup": true
}

Example response:

HTTP/1.1 202 ACCEPTED
Content-Type: "application/json"

{
   "status": "started",
   "reference_id": "config_apio_v200_foo_foogroup"
}
Request JSON Object:
  • group (array) – A list of entities to backup for the group. See Backup Group List.

  • user (array) – A list of entities to backup for each user. See Backup User List.

  • formats (object) – An object as defined as Backup builds.

  • dowload_announcement_files (boolean) – If set the announcement files will be backed up, otherwise not.

  • force_backup (boolean) – If set it will stop all previous backups of the same group and start a new one.

Response JSON Object:
  • status (string) – The status of the backup process. One of “pending” or “finished”.

  • reference_id (string) – The ID of the ongoing backup.

Status Codes:

Poll backup process status

GET /api/v1/tenants/(string: tenant_id)/groups/(string: group_id)/batch/backup/polling/(string: instance_name)/

Checks the status of the backup process for the current Group.

The polling must be done in the same session of the backup’s start. If the session crashes the backup could work, but it’s not guaranteed.

Example request:

GET /api/v1/tenants/foo/groups/foogroup/batch/backup/polling/config_apio_v200_foo_foogroup/ HTTP/1.1
Host: example.com

{
   "formats": [
      "xml",
      "json"
   ],
   "type": "report"
}

Example response:

HTTP/1.1 200 Ok
Content-Type: "application/json"

{
   "status": "pending",
   "reference_id": "config_apio_v200_foo_foogroup"
}

or

HTTP/1.1 200 Ok
Content-Type: "application/json"

{
   "status": "finished",
   "data": {
      "main": {
         "tenant_id": "foo",
         "group_id": "foogroup",
         "user_id": "foouser",
         "start_datetime": "2019-05-10 15:31:59.262488",
         "end_datetime": "2019-05-10 15:40:00.223488",
         "sw_version": "2.0.0",
         "successful_calls": 150,
         "error_calls": 5,
         "has_errors": true
      },
      ...
   }
}
Request JSON Object:
  • formats (object) – An object as defined as Backup builds.

  • type (string) – The type of backup to perform. Allowed values: “report”, “full”. Default: “full”.

Response JSON Object:
  • status (string) – The status of the backup process. One of “pending” or “finished”.

  • reference_id (string) – The ID of the ongoing backup.

  • data (object) – an object representing all the configuration backed up by the process. See Backup data.

Status Codes:

Retrieve backups list

GET /api/v1/tenants/(string: tenant_id)/groups/(string: group_id)/batch/backups/

Retrieve the list of all backups for that specific group.

Example request:

GET /api/v1/tenants/foo/groups/foogroup/batch/backups/config_apio_v200_foo_foogroup/ HTTP/1.1
Host: example.com

{}

Example response:

HTTP/1.1 200 Ok
Content-Type: "application/json"

{
   "backups": [
      {
         "id": "config_apio_v200_foo_foogroup",
         "tenant_id": "foo",
         "group_id": "foogroup",
         "user_id": "foouser",
         "start_datetime": "2019-05-10 15:31:59.262488",
         "end_datetime": "2019-05-10 15:40:00.223488",
         "sw_version": "2.0.0",
         "successful_calls": 150,
         "error_calls": 5,
         "has_errors": true
      }
   ]
}
Response JSON Object:
Status Codes:

Retrieve backup

GET /api/v1/tenants/(string: tenant_id)/groups/(string: group_id)/batch/backups/(string: instance_name)/

Retrieve the data of a already done backup. The parameter instance_name is optional, if not provided it will return the latest backup of the current group.

Example request:

GET /api/v1/tenants/foo/groups/foogroup/batch/backups/config_apio_v200_foo_foogroup/ HTTP/1.1
Host: example.com

{
   "formats": [
      "xml",
      "json"
   ],
   "type": "report"
}

Example response:

HTTP/1.1 200 Ok
Content-Type: "application/json"

{
   "reference_id": "config_apio_v200_foo_foogroup"
   "data": {
      "main": {
         "tenant_id": "foo",
         "group_id": "foogroup",
         "user_id": "foouser",
         "start_datetime": "2019-05-10 15:31:59.262488",
         "end_datetime": "2019-05-10 15:40:00.223488",
         "sw_version": "2.0.0",
         "successful_calls": 150,
         "error_calls": 5,
         "has_errors": true
      },
      ...
   }
}
Request JSON Object:
  • formats (object) – An object as defined as Backup builds.

  • type (string) – The type of backup to perform. Allowed values: “report”, “full”. Default: “full”.

Response JSON Object:
  • reference_id (string) – The ID of the ongoing backup.

  • data (object) – an object representing all the configuration backed up by the process. See Backup data.

Status Codes:

Stop running backup

GET /api/v1/tenants/(string: tenant_id)/groups/(string: group_id)/batch/backup/stop/(string: instance_name)/

Stops a running backup process for the current Group.

Example request:

GET /api/v1/tenants/foo/groups/foogroup/batch/backup/stop/config_apio_v200_foo_foogroup/ HTTP/1.1
Host: example.com

Example response:

HTTP/1.1 200 Ok
Content-Type: "application/json"
Status Codes:

Backup Group List

The backup feature supports the following entities to backup for the group:

  • profile: all the configurations for the profile.

  • ivr: all the configurations for the ivrs.

  • call_center: all the configurations for the call_centers.

  • music_on_hold: all the configurations for the music on hold.

  • phone_book: all the configurations for the phone book.

  • call_pickup: all the configurations for the call pickup.

  • announcements: all the configurations for the announcements. If download_announcement_files flag is True, it will download the files also.

  • time_schedule: all the configurations for the time schedules.

  • calendar_schedule: all the configurations for the calendar schedules.

  • access_devices: all the configurations for the access devices.

Backup User List

The backup feature supports the following entities to backup for the user:

  • profile: all the configurations for the profile for each user.

  • phone_book: all the configurations for the phone books for each user.

  • announcements: all the configurations for the announcements for each user. If download_announcement_files flag is True, it will download the files also.

  • services: all the configurations for the services for each user.

  • voice_mail: all the configurations for the voice mails for each user.

Backup builds

The backup supports the following output formats

  • xml

  • json

Backup data

It’s the result of the backup process

Name

Type

Method

Description

GET

info

Object

A

Information about the backup process. See Backup data info.

group

Object

A

All the configs for each entity requested for the group. See Backup data entity.

user

Object

A

All the configs for each entity requested for each user in the group. See Backup data entity.

Backup data info

Name

Type

Method

Description

GET

id

String

C

The ID of the backup. Only present in backup list calls.

tenant_id

String

A

The tenant id of the backup.

group_id

String

A

The group id of the backup.

user_id

String

A

The user id of the user who performed the backup.

start_datetime

DateTime

A

The timestamp when the backup is started.

end_datetime

DateTime

A

The timestamp when the backup is ended.

sw_version

String

A

The version of APIO.

successful_calls

Integer

A

Number of successful calls.

error_calls

Integer

A

Number of error calls.

has_errors

Boolean

A

True if there are error calls, False otherwise.

Backup data entity

Name

Type

Method

Description

GET

success

Array

A

A list of all the successful requests.

errors

Array

A

A list of all the errors.

ignored_entities

Array

A

A list of all the entities requested that cannot be processed.