Overview
The Sectores (Sectors) endpoint allows you to create and manage geographic sectors for advertising campaigns. Each sector defines a virtual geofence with coordinate boundaries and is associated with a specific company and campaign. The geographic data is stored in JSON format for flexibility.Base URL
Endpoints
List All Sectors
Retrieve a list of all geographic sectors. ResponseUnique identifier for the sector (auto-generated)
Foreign key to the company (Empresa) that owns this sector
Foreign key to the advertising campaign (CampanaPublicitaria) this sector belongs to
Name of the sector (max 100 characters)
Date when the sector was created (format: YYYY-MM-DD)
JSON field containing the virtual geofence coordinates. Typically an array of coordinate objects defining the polygon boundary.
JSON field containing the center coordinates of the sector. Typically includes latitude and longitude (default: empty object)
Map zoom level for displaying the sector
Foreign key to the city where the sector is located
Foreign key to the country where the sector is located
Date when the sector was last modified (format: YYYY-MM-DD)
Sector status (0: inactive, 1: active)
Create a Sector
Create a new geographic sector with virtual boundaries. Request BodyID of the company owning this sector
ID of the campaign this sector belongs to
Name of the sector (max 100 characters)
Creation date (YYYY-MM-DD)
Virtual geofence coordinates defining the sector boundary. Should be a JSON array of coordinate objects.Example structure:
Center coordinates of the sector (default: )Example structure:
Map zoom level (typically between 1-20)
ID of the city for this sector
ID of the country for this sector
Modification date (YYYY-MM-DD)
Sector status (0: inactive, 1: active)
Retrieve a Sector
Retrieve details of a specific sector by ID.Update a Sector
Update all fields of a specific sector. Partially update specific fields of a sector.Delete a Sector
Delete a specific sector by ID.Special Endpoints
Get Sectors by User
Retrieve sectors filtered by user role and permissions. Behavior by Role:- Administrator (role 1): Returns all sectors
- Publicista (role 2): Returns sectors for companies associated with the publicist
- Empresa (role 3): Returns sectors for the specific company
Example Usage
Creating a Sector with Geographic Boundaries
Notes
- The
cerco_virtualfield must contain valid JSON with coordinate data - The
centrofield is typically used for map centering and can be calculated as the centroid of the polygon - Coordinates should follow standard latitude/longitude format
- The
zoomlevel should be appropriate for the size of the sector area