
The Rectifications API provides access to information in the register of rectifications of the Idescat website.
The use of this service requires acceptance of the Terms of use of Idescat's APIs.
| Base URI | http://api.idescat.cat/rectificacions/v1/{operation}.{format}[?parameters] |
|---|---|
| HTTP Method | GET |
| Response Formats | xml, json, php |
| Version | 1.00 (10.20.2010) |
| Shortcuts | Request, Response |
| Operations | cerca, categories |
| Widgets that use this service | — |
Every request must by obligation specify the service, version, operation and format. Version and operation are specific characteristics of each service. The rectifications service supports the formats for general responses of Idescat APIs. For more information, see the Anatomy of requests sections of the general documentation on Idescat APIs.
The identifier of this service is rectificacions.
http://api.idescat.cat/rectificacions/v1/{…}
This service admits two types of operation:
http://api.idescat.cat/rectificacions/v1/cerca.{…}
http://api.idescat.cat/rectificacions/v1/categories.{…}
The specific parameters make it possible to choose the information that will be returned by a certain operation of the service. These can be specified as individual parameters or as a unique parameter p (compact form).
To find out about the general parameters available for any service, please see the documentation on Idescat APIs.
The operation cerca can be invoked without using any specific parameters (unfiltered results). In this case, it will return the older rectifications.
http://api.idescat.cat/rectificacions/v1/cerca.json?enc=iso-8859-1&lang=en
To access the most recent rectifications you must use the parameter desc (or the parameter posicio).
As some searches can return a very high number of results, the response will not always include all of them. The parameter posicio makes it possible to specify which should be the first result to be included in the response. By default, posicio equals zero.
http://api.idescat.cat/rectificacions/v1/cerca.xml?posicio=20&lang=en
The elements of the responses opensearch:totalResults and opensearch:itemsPerPage make it possible to determine whether all of the results are shown or not.
When not accompanied by the scheme parameter (see following section), the id parameter enables selection of the information on an individual rectification.
http://api.idescat.cat/rectificacions/v1/cerca.xml?id=27&lang=en
This parameter, accompanied by the id parameter, makes it possible to filter the results for some of the categories used in the categorisation of the rectifications. To find out the categorisation criteria, use the operation categories.
The scheme parameter is used to select the criterion and the id parameter is used to select the category.
http://api.idescat.cat/rectificacions/v1/cerca.xml?scheme=tema&id=treball&lang=en
To include more than one category, use a comma.
http://api.idescat.cat/rectificacions/v1/cerca.xml?scheme=tema&id=treball,turisme&lang=en
To simultaneously filter according to two criteria use "+" in the parameter scheme and id:
http://api.idescat.cat/rectificacions/v1/cerca.xml?scheme=tema+servei&id=treball,turisme+aec&lang=en
These parameters filter the results according to a period of time: according to the date on which the information was published (published) and according to the date when the rectification was made (updated). One must specify at least one day, month and year in the format YYYYMMDD.
http://api.idescat.cat/rectificacions/v1/cerca.xml?updated=20100101&lang=en
To define an interval, use a hyphen.
http://api.idescat.cat/rectificacions/v1/cerca.xml?updated=20100101-20100131&lang=en
The hyphen can be used to select the rectifications on a certain day.
http://api.idescat.cat/rectificacions/v1/cerca.xml?updated=20101008-20101008&lang=en
By default, the results are shown in ascending order of the date of update (updated). The parameters orderby and desc will modify this criterion.
The categories operation can be invoked without using any specific parameter in order to obtain the identifiers of the criteria for the categorisation of the information.
http://api.idescat.cat/rectificacions/v1/categories.php?lang=en
The identifiers returned can be used as an id parameter (see following section) in order to obtain their categories.
To obtain the categories used in a certain criterion, use the id parameter.
http://api.idescat.cat/rectificacions/v1/categories.xml?id=tema&lang=en
As in the case of other APIs, this one also accepts requests with a syntax that does not require the specification of operations (categories and cerca, in this case; see the general documentation on Idescat APIs, section 1.4. Invocation without operation). However, the advantages of this type of invocation are less clear than for other APIs because it does not imply any significant simplification of the requests, as they still require the use of two types of resource (categories and rectificacions).
http://api.idescat.cat/rectificacions/v1/categories.xml?lang=en
http://api.idescat.cat/rectificacions/v1/categories/tema.json?lang=en
http://api.idescat.cat/rectificacions/v1/rectificacions.php?updated=20101008-20101008&lang=en
http://api.idescat.cat/rectificacions/v1/rectificacions.xml?scheme=tema&id=treball&lang=en
http://api.idescat.cat/rectificacions/v1/rectificacions/27.xml?lang=en
In order to find out the HTTP response codes returned and the formats supported by any service, see section 2 of Idescat APIs.
To describe the information, the Rectifications API uses the standard Atom, as it treats lists of rectifications (cerca operation) as categorisation criteria or categories (categories operation).
To describe rectifications, the cerca operation uses the standard Atom enriched with elements of the standard OpenSearch. See the documentation on these standards to find out about the response structure of the cerca operation: only some elements of the entry element that have special uses are documented here.
The cerca operation uses the title element to specify the information affected by the rectification.
<entry> <title xml:lang="en">Registered unemployment</title> ... </entry>
The cerca operation uses the published element to specify the date on which the information was published before being rectified and the updated element for the date when the rectification was made.
<published>2009-01-10</published> <updated>2010-02-15</updated>
The cerca operation includes the description of the rectification of the content element in XHTML format.
<content xml:lang="en" type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
...
</div>
</content>
The links to the pages affected by the rectification are included in link elements with an attribute rel that is equal to via. The title attribute is used to offer a description of the page affected in the requested language.
<link
rel="via"
xml:lang="en"
type="text/html"
href="http://www.idescat.cat/pub/?id=lma&n=8.3.1.1&lang=en"
title="People aged 16 or more that are in favour of taking measures for the protection of the environment.
By territorial areas and type of measure"
/>
<link
rel="via"
xml:lang="en"
type="text/html"
href="http://www.idescat.cat/pub/?id=lma&n=8.3.1.2&lang=en"
title="People aged 16 or more that are in favour of taking measures for the protection of the environment.
By size of municipality and type of measure"
/>
The cerca operation classifies the different results using category elements. The scheme attribute indicates the categorisation criterion with the request to the API that returns its list of possible categories (see section 2.2.). The term attribute indicates the identifier of the category. The label attribute includes a descriptive literal of the category in the language of the request.
<category scheme="http://api.idescat.cat/rectificacions/v1/categories.xml?id=tema&lang=en" term="treball" label="Labour" xml:lang="en" /> <category scheme="http://api.idescat.cat/rectificacions/v1/categories.xml?id=servei&lang=en" term="aec" label="Statistical Yearbook of Catalonia " xml:lang="en" /> <category scheme="http://api.idescat.cat/rectificacions/v1/categories.xml?id=servei&lang=en" term="epa" label="Active Population Survey" xml:lang="en" />
The categories operation exposes the categorisation of the rectifications using the standard Atom. See the documentation on these standards to find out about the response structure of the categories operation: only some elements of the entry element that have special uses are documented here.
When the categories operation is invoked without a parameter id (list of categorisation criteria), the title element of each entry includes the identifier of the categorisation criterion.
<entry>
<id>tag:idescat.cat,2010:rectificacions/categories/tema</id>
<title>tema</title>
<content xml:lang="en">Topics</content>
<category term="1" />
<link
rel="alternate"
href="http://api.idescat.cat/rectificacions/v1/categories.xml?id=tema&lang=en"
type="application/atom+xml"
/>
<updated>2010-10-15</updated>
</entry>
When the categories operation is invoked with an id parameter (list of categories of the selected criterion), the title element of each entry includes the identifier of the category.
<entry> <id>tag:idescat.cat,2010:rectificacions/categories/tema/macromagnituds</id> <title>macromagnituds</title> <content xml:lang="en">Macro magnitudes</content> <updated>2010-10-15</updated> </entry>
When the categories operation is invoked without an id parameter (list of categorisation criteria), the link element of each entry includes in its href attribute the request to the API for the list of categories of the specified criterion in the title element of the entry.
<entry>
<id>tag:idescat.cat,2010:rectificacions/categories/tema</id>
<title>tema</title>
<content xml:lang="en">Topics</content>
<category term="1" />
<link
rel="alternate"
href="http://api.idescat.cat/rectificacions/v1/categories.xml?id=tema&lang=en"
type="application/atom+xml"
/>
<updated>2010-10-15</updated>
</entry>
When the categories operation is invoked with an id parameter (list of categories of the selected criterion), the link element does not appear.
When the categories operation is invoked without an id parameter (list of categorisation criteria), the content element includes the literal associated to the identifier of the categorisation criterion that appears in the title element.
<entry>
<id>tag:idescat.cat,2010:rectificacions/categories/tema</id>
<title>tema</title>
<content xml:lang="en">Topics</content >
<category term="1" />
<link
rel="alternate"
href="http://api.idescat.cat/rectificacions/v1/categories.xml?id=tema&lang=en"
type="application/atom+xml"
/>
<updated>2010-10-15</updated>
</entry>
This same literal appears within the title element of feed when the categories operation is invoked with id.
<feed xmlns="http://www.w3.org/2005/Atom"> <id>tag:idescat.cat,2010:rectificacions/categories/tema</id> <title xml:lang="en">Topics</title> <category term="1" /> ... </feed>
When the categories operation is invoked with an id parameter (list of categories of the selected criteria), the content element includes the literal associated to the identifier of the category that appears in the title element.
<entry> <id>tag:idescat.cat,2010:rectificacions/categories/tema/macromagnituds</id> <title>macromagnituds</title> <content xml:lang="en">Macro magnitudes</content> <updated>2010-10-15</updated> </entry>
The categories operation uses the term attribute of the category element to express whether one and only one category of the criterion in question should appear for each rectification ("1"), whether at least one should appear but more can appear ("+"), whether more than one can appear but also none ("*") or whether the category has to be unique but there can be none ("?").
When the categories operation is invoked without an id parameter (list of categorisation criteria), the category element is associated to each entry element.
<entry>
<id>tag:idescat.cat,2010:rectificacions/categories/tema</id>
<title>tema</title>
<content xml:lang="en">Topics</content >
<category term="1" />
<link
rel="alternate"
href="http://api.idescat.cat/rectificacions/v1/categories.xml?id=tema&lang=en"
type="application/atom+xml"
/>
<updated>2010-10-15</updated>
</entry>
When the categories operation is invoked with an id parameter (list of categories of the selected criterion), the category element is associated to the feed element.
<feed xmlns="http://www.w3.org/2005/Atom"> <id>tag:idescat.cat,2010:rectificacions/categories/tema</id> <title xml:lang="en">Topics</title> <category term="1" /> ... </feed>
Idescat APIs use standardised response codes to show whether the request has been successful or has failed.