Skip to main content
Skip table of contents

How to manage batch numbers through CSV

Overview

This document describes how to manage batch numbers through a CSV file. You can efficiently use a CSV file for different operations, such as Create, Update, Attach, Detach, and Delete.

To make changes using the CSV file, you're required to have OWNER role. You also need to respect the configured limits per application.

Authentication

Navigate to the API Authentication to learn more about Authorization Token Endpoint and Authentication process.

Error Codes

Omilia's HTTP response codes can be found on the HTTP Code Responses page.

API Reference

In this section, you will find a comprehensive explanation of managing batch numbers using CSV files. The process consists of three main steps for clear and straightforward execution.

{{baseUrl}} depends on the user's environment which could be the following:

EU1 - https://eu1-m.ocp.ai/integrations

US1 - https://us1-m.ocp.ai/integrations

US2 - https://us2-m.ocp.ai/integrations

US1W - https://us1-w-m.ocp.ai/integrations

Step 1: Access the CSV file

The CSV file can be downloaded via the following endpoint:

POST

{{baseUrl}}/api/numbers/csv

Retrieves numbers as a CSV file.

Click to see the details

The CSV file contains data on numbers structured as follows:

  • APPLICATION_TAG: [empty]

  • COUNTRY: US

  • GROUP_ID: ocp

  • LOCALE: en-US

  • MINIAPP_DIAMANT_APP_NAME: miniApps

  • MINIAPP_GROUP: ocp

  • MINIAPP_ID: test.surname_test.Numeric.MiniApps.ocp

  • MINIAPP_NAME: czindros_test

  • MINIAPP_TYPE: Numeric

  • NUMBER: (UUID)

  • PHONE_NUMBER_SET_ID: testSetId

  • NOTE: [empty]

Below you can see a file example:

screenshot_1.png

This structure is identical to what you will find in OCPIntegrations -> Numbers.

ocp-numbers.png

Step 2: Prepare CSV for operations

For operations via the endpoint below, you are required to add an OPERATION column:

PUT

{{baseUrl}}/api/numbers/csv

Execute operations on numbers using a CSV file.

You can execute such operations as Create, Update, Attach, Detach, and Delete. If the operation involves acquiring a new number, ensure you also include a PROVIDER column.

Null or empty fields are ignored during the CSV file check.

Create

Click to see the required fields

The required fields are as follows:

  • GROUP_ID

  • NUMBER

  • OPERATION

  • PROVIDER

Below you can see a file example for the Create operation:

screenshot_2.png

When using the Create operation, you need to specify the provider. For example, when dealing with numbers related to the Twilio service, simply use twilio as the provider.

Update

Click to see the details

The required fields are the following:

  • NUMBER

  • MINIAPP_ID

  • PHONE_NUMBER_SET_ID

  • APPLICATION_TAG

  • LOCALE

  • NOTE

  • OPERATION

You will find an example below:

screenshot_3.png

When you specify PHONE_NUMBER_SET_ID, the number will be moved to that set, and it should be the same as the number's group.

If a MINIAPP_ID is specified, the number will be attached to that application.

If you want to remove the value in any field, use <NULL>.

Attach

Click to see the details

The following fields are necessary:

  • NUMBER

  • MINIAPP_ID

  • OPERATION

  • LOCALE

Mind that LOCALE and MINIAPP_ID are mandatory fields.

Below you can see an example:

screenshot_4.png

Detach

Click to see the details

The required fields are:

  • NUMBER

  • OPERATION

Below you can see a file example for the Detach operation:

screenshot_5.png

Delete

Click to see the details

The required fields are:

  • NUMBER

  • OPERATION

Below you can see a file example for the Delete operation:

screenshot_6.png

Step 3: Execute operations

To make changes using the CSV file, you're required to have OWNER role.

Each type of operation has its limits, which are configured based on the application. Below you can find the default limits for the operations:

  • Update: 800

  • Attach: 800

  • Detach: 100

  • Delete: 10

  • Create: 100

The default limits might be reconfigured for specific environments.

To perform operations on multiple numbers from different groups, you must have the appropriate permissions for each number’s group.

For more information on executing operations via CSV, refer to the Batch numbers management through API available on this link.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.