Skip to main content
GET
/
ObtenirActualitzacions
ObtenirActualitzacions
curl --request GET \
  --url https://api.example.com/ObtenirActualitzacions
{
  "Actualitzacions": {
    "Retorn": {
      "CodiRetorn": 123,
      "DescRetorn": "<string>"
    },
    "Seguent": "<string>",
    "Articles": [
      {
        "ActualitzacioArticle": {
          "Cdclie": "<string>",
          "TipusActualitzacio": "<string>",
          "artreg": 123,
          "cnorma": "<string>",
          "dsarti": "<string>",
          "sqregl": 123
        }
      }
    ],
    "Municipis": [
      {
        "ActualitzacioMunicipi": {
          "Cdclie": "<string>",
          "TipusActualitzacio": "<string>",
          "cine10": "<string>",
          "dsnomc": "<string>",
          "dsnom1": "<string>",
          "dsnom2": "<string>"
        }
      }
    ],
    "Conductes": [
      {
        "ActualitzacioConducta": {
          "sqcond": 123,
          "cdcond": 123,
          "dscoc1": "<string>",
          "dscoc2": "<string>",
          "dscoc3": "<string>",
          "dscoe1": "<string>",
          "dscoe2": "<string>",
          "dscoe3": "<string>",
          "import": 123,
          "impbon": 123,
          "npunts": 123,
          "grainf": "<string>",
          "regl": 123
        }
      }
    ],
    "Carrerer": [
      {}
    ],
    "Models": [
      {}
    ],
    "Colors": [
      {}
    ],
    "Motius": [
      {}
    ],
    "Organs": [
      {}
    ],
    "VehiclesPrecintats": [
      {}
    ],
    "Documents": [
      {}
    ],
    "TipusIncidencia": [
      {}
    ],
    "AmbitsIncidencia": [
      {}
    ],
    "ObjectesIncidencia": [
      {}
    ],
    "AnomaliesIncidencia": [
      {}
    ]
  }
}

Overview

The ObtenirActualitzacions endpoint retrieves updates to master data files required for recording fines and incidents. This endpoint supports pagination through a continuation token mechanism to handle large datasets efficiently.

Authentication

This endpoint requires device authentication using the device identifier (IMEI) and municipality code.
pIMEI
string
required
Device identifier: maximum 15 alphanumeric positions
pClient
string
required
Municipality code according to ORGT codification

Query Parameters

pData
string
required
Date of the last master data update, in format yyyyMMddHHmm.When incorporating a new municipality, download master data from 190001010000 (January 1, 1900) to ensure all data is retrieved. Subsequently, periodic downloads can use the date of the last download to obtain only updates.Example: 202603010830 (March 1, 2026 at 08:30)
pSeguent
string
required
Continuation token identifying the next page of master data to download.
  • On the first call, leave this parameter empty
  • To obtain all available updates, make successive calls passing the string returned in the previous call
  • When the endpoint returns an empty string, there are no more updates to download

Pagination Logic

To retrieve all master data updates:
  1. First request: Set pSeguent to empty string ""
  2. Check response: Examine the Seguent field in the response
  3. Continue fetching: If Seguent is not empty, make another request with pSeguent set to the returned value
  4. Completion: When Seguent returns empty, all updates have been retrieved
Example Pagination
let seguent = "";
let allUpdates = [];

do {
  const response = await fetch(
    `/ObtenirActualitzacions?pIMEI=${imei}&pClient=${client}&pData=${lastUpdate}&pSeguent=${seguent}`
  );
  const data = await response.text();
  // Parse XML and extract updates
  allUpdates.push(data);
  
  // Extract continuation token
  seguent = extractSeguent(data);
} while (seguent !== "");

Response Schema

Actualitzacions
object
Root element containing all master data updates
Retorn
object
Operation result information
CodiRetorn
integer
Return code: 0 indicates success, negative values indicate errors
DescRetorn
string
Description of the return code (empty on success)
Seguent
string
Continuation token for the next page. Empty string indicates no more data.Example: ART00342261
Articles
array
Array of article updates
ActualitzacioArticle
object
Cdclie
string
Municipality code
TipusActualitzacio
string
Update type: Alta, Baixa, or Modificacio
artreg
integer
Article number
cnorma
string
Regulation code (e.g., RGC)
dsarti
string
Article description
sqregl
integer
Regulation sequence number
Municipis
array
Array of municipality updates
ActualitzacioMunicipi
object
Cdclie
string
Municipality code (ORGT)
TipusActualitzacio
string
Update type
cine10
string
INE code (10 digits)
dsnomc
string
Municipality short name
dsnom1
string
Municipality name part 1
dsnom2
string
Municipality name part 2
Conductes
array
Array of conduct/infraction updates
ActualitzacioConducta
object
sqcond
integer
Conduct sequence number
cdcond
integer
Conduct code
dscoc1
string
Catalan description line 1
dscoc2
string
Catalan description line 2
dscoc3
string
Catalan description line 3
dscoe1
string
Spanish description line 1
dscoe2
string
Spanish description line 2
dscoe3
string
Spanish description line 3
import
integer
Fine amount
impbon
integer
Reduced amount
npunts
integer
License points deducted
grainf
string
Infraction severity
regl
integer
Regulation reference
Carrerer
array
Array of street directory updates
Models
array
Array of vehicle model updates
Colors
array
Array of color updates
Motius
array
Array of reason/motive updates
Organs
array
Array of administrative organ updates
VehiclesPrecintats
array
Array of sealed vehicle updates
Documents
array
Array of document updates
TipusIncidencia
array
Array of incident type updates
AmbitsIncidencia
array
Array of incident scope updates
ObjectesIncidencia
array
Array of incident object updates
AnomaliesIncidencia
array
Array of incident anomaly updates

XML Response Example

<Actualitzacions xmlns="http://schemas.datacontract.org/2004/07/WcfMultesPDA" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
	<AmbitsIncidencia/>
	<AnomaliesIncidencia/>
	<Articles>
		<ActualitzacioArticle>
			<Cdclie>006</Cdclie>
			<TipusActualitzacio>Alta</TipusActualitzacio>
			<artreg>20</artreg>
			<cnorma>RGC</cnorma>
			<dsarti>NIVELLS D'ALCOHOL EN SANG I AIRE ESPT</dsarti>
			<sqregl>1655</sqregl>
		</ActualitzacioArticle>
		<ActualitzacioArticle>
			<Cdclie>006</Cdclie>
			<TipusActualitzacio>Alta</TipusActualitzacio>
			<artreg>46</artreg>
			<cnorma>RGC</cnorma>
			<dsarti>MODERACIÓ DE LA VELOCITAT. SUPÒS</dsarti>
			<sqregl>1657</sqregl>
		</ActualitzacioArticle>
	</Articles>
	<Carrerer/>
	<Colors/>
	<Conductes/>
	<Documents/>
	<Models/>
	<Motius/>
	<Municipis/>
	<ObjectesIncidencia/>
	<Organs/>
	<Retorn>
		<CodiRetorn>0</CodiRetorn>
		<DescRetorn/>
	</Retorn>
	<Seguent>ART00342261</Seguent>
	<TipusIncidencia/>
	<VehiclesPrecintats/>
</Actualitzacions>

Update Types

All master data entities include a TipusActualitzacio field indicating the update type:
  • Alta (0): New record
  • Baixa (1): Deleted record
  • Modificacio (2): Modified record

Usage Patterns

Initial Sync

When setting up a new device or municipality, perform a full sync from 1900:
const fullSync = async (imei, client) => {
  const updates = [];
  let seguent = "";
  const initialDate = "190001010000"; // January 1, 1900
  
  do {
    const response = await getActualitzacions(imei, client, initialDate, seguent);
    updates.push(response);
    seguent = response.Seguent;
  } while (seguent);
  
  return updates;
};

Periodic Updates

For regular synchronization, use the last successful update timestamp:
const periodicSync = async (imei, client, lastUpdateDate) => {
  const updates = [];
  let seguent = "";
  
  do {
    const response = await getActualitzacions(imei, client, lastUpdateDate, seguent);
    updates.push(response);
    seguent = response.Seguent;
  } while (seguent);
  
  // Save new timestamp for next sync
  const now = new Date().toISOString().replace(/[-:T]/g, '').slice(0, 12);
  saveLastUpdateDate(now);
  
  return updates;
};

Processing Updates

Handle different update types appropriately:
const processUpdates = (actualitzacions) => {
  // Process each master data type
  actualitzacions.Articles?.forEach(article => {
    switch (article.TipusActualitzacio) {
      case 'Alta':
        insertArticle(article);
        break;
      case 'Baixa':
        deleteArticle(article);
        break;
      case 'Modificacio':
        updateArticle(article);
        break;
    }
  });
  
  // Repeat for other master data types...
};

Build docs developers (and LLMs) love