Skip to main content
CRM & Sales

Information Collections

Manage onboarding forms for technical data collection including PBX configuration, with customer-facing token access.

Base URL: /api/v1/information-collections

Auth required: Yes (auth:api) for all endpoints.

Note: /api/v1/information_collections (camelCase) is a deprecated alias.

Information collections are forms sent to customers to collect technical onboarding information (e.g. PBX configuration data). They have a status (open/closed) and a type.


Model Properties

Information Collection

Property Type Required Description
id integer auto Unique identifier
customer_file_id integer Yes FK to customer_files. The customer file this collection belongs to
status string auto Status of the collection: open (being filled) or closed (submitted/completed). Set to open on creation
type string No Collection type identifier (determines the form template shown to the customer)
content longtext No JSON-encoded form data. Filled progressively by the customer via the public token endpoint
created_at datetime auto Creation timestamp
updated_at datetime auto Last update timestamp

Read-only computed field (appended in responses):

Property Type Description
front_url string The public URL to send to the customer for filling in the form (token-based, no login required)

Note: Only one information collection can exist per customer file. The POST endpoint returns an error if one already exists.


GET /v1/information-collections

List information collections, optionally filtered by status or customer file.

Query parameters:

Parameter Type Description
status string Filter by status (e.g. open, closed)
customer_file_id integer Filter by customer file

Response 200: Array of information collection objects.

Returned columns: id, customer_file_id, status, type, created_at, updated_at. Relations included: customer_file and its fileable (with nested relations). Appended: front_url (the URL to send to the customer).

Examples:

curl -X GET "https://your-instance.bluerocktel.net/api/v1/information-collections?status=open&customer_file_id=10" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"
import requests

response = requests.get(
    "https://your-instance.bluerocktel.net/api/v1/information-collections",
    params={"status": "open", "customer_file_id": 10},
    headers={"Authorization": "Bearer YOUR_API_TOKEN"}
)
collections = response.json()
$response = Http::withToken('YOUR_API_TOKEN')
    ->get('https://your-instance.bluerocktel.net/api/v1/information-collections', [
        'status' => 'open',
        'customer_file_id' => 10,
    ]);

$collections = $response->json();
const response = await fetch(
  "https://your-instance.bluerocktel.net/api/v1/information-collections?status=open&customer_file_id=10",
  {
    headers: {
      "Authorization": "Bearer YOUR_API_TOKEN",
      "Accept": "application/json"
    }
  }
);
const collections = await response.json();

POST /v1/information-collections

Create a new information collection for a customer file. Only creates one if none already exists for that file.

Query parameters:

Parameter Type Required Description
customer_file_id integer Yes Customer file ID

The collection is created with status = 'open'.

Response 200: Created information collection object. Response 422: Validation error or already exists.

Examples:

curl -X POST "https://your-instance.bluerocktel.net/api/v1/information-collections?customer_file_id=10" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"
import requests

response = requests.post(
    "https://your-instance.bluerocktel.net/api/v1/information-collections",
    params={"customer_file_id": 10},
    headers={"Authorization": "Bearer YOUR_API_TOKEN"}
)
collection = response.json()
$response = Http::withToken('YOUR_API_TOKEN')
    ->post('https://your-instance.bluerocktel.net/api/v1/information-collections?customer_file_id=10');

$collection = $response->json();
const response = await fetch(
  "https://your-instance.bluerocktel.net/api/v1/information-collections?customer_file_id=10",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer YOUR_API_TOKEN",
      "Accept": "application/json"
    }
  }
);
const collection = await response.json();

GET /v1/information-collections/{id}

Get a single information collection by ID. Includes customer_file and fileable relations. Appends front_url.

URL parameters:

Parameter Type Description
id integer Information collection ID

Response 200: Information collection object. Response 404: Not found.


PUT /v1/information-collections/{id}

Update an information collection.

URL parameters:

Parameter Type Description
id integer Information collection ID

Body (JSON): Validated via information_collection::attributes('common').

Response 201: Updated object. Response 404: Not found. Response 422/500: Error.


DELETE /v1/information-collections/{id}

Delete an information collection.

URL parameters:

Parameter Type Description
id integer Information collection ID

Response 200: { "message": "element deleted" }


GET /v1/information-collections/{id}/pbx-config

Get the PBX configuration derived from an information collection. Returns the structured PBX config object.

URL parameters:

Parameter Type Description
id integer Information collection ID

Response 200: PBX configuration object (pbx_configuration::fromInformationCollection()).

Examples:

curl -X GET "https://your-instance.bluerocktel.net/api/v1/information-collections/5/pbx-config" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"
import requests

response = requests.get(
    "https://your-instance.bluerocktel.net/api/v1/information-collections/5/pbx-config",
    headers={"Authorization": "Bearer YOUR_API_TOKEN"}
)
pbx_config = response.json()
$response = Http::withToken('YOUR_API_TOKEN')
    ->get('https://your-instance.bluerocktel.net/api/v1/information-collections/5/pbx-config');

$pbxConfig = $response->json();
const response = await fetch(
  "https://your-instance.bluerocktel.net/api/v1/information-collections/5/pbx-config",
  {
    headers: {
      "Authorization": "Bearer YOUR_API_TOKEN",
      "Accept": "application/json"
    }
  }
);
const pbxConfig = await response.json();

GET /v1/information-collections/providers-3cx

Get available 3CX provider templates for use in information collection forms.

Response 200: Array of 3CX provider template objects.


Customer-Facing Token Endpoints

These endpoints are unauthenticated (no auth:api middleware). They use a token to allow customers to fill in their information collection form.

GET /v1/customer-information-collection/{token}

Get an information collection by its public token.

URL parameters:

Parameter Type Description
token string Public access token

Response 200: Information collection data. Response 404: Token not found.

Examples:

curl -X GET "https://your-instance.bluerocktel.net/api/v1/customer-information-collection/abc123def456" \
  -H "Accept: application/json"
import requests

response = requests.get(
    "https://your-instance.bluerocktel.net/api/v1/customer-information-collection/abc123def456"
)
collection = response.json()
$response = Http::get('https://your-instance.bluerocktel.net/api/v1/customer-information-collection/abc123def456');

$collection = $response->json();
const response = await fetch(
  "https://your-instance.bluerocktel.net/api/v1/customer-information-collection/abc123def456",
  {
    headers: { "Accept": "application/json" }
  }
);
const collection = await response.json();

PUT /v1/customer-information-collection/{token}

Update an information collection via public token (customer filling in the form).

URL parameters:

Parameter Type Description
token string Public access token

Body (JSON): Form data fields.

Response 200: Updated information collection.


GET /v1/customer-information-collection/{token}/validate

Check if the information collection is valid and complete.

Response 200: Validation result.


GET /v1/customer-information-collection/{token}/close

Close/submit an information collection (mark as completed by customer).

Response 200: Closed collection.


POST /v1/customer-information-collection/{token}/file

Upload a file attachment to an information collection via public token.

Body (multipart/form-data): File upload.

Response 201: Stored file.