# Etag not in header of company profile

**URL:** <http://forum.companieshouse.gov.uk/t/etag-not-in-header-of-company-profile/1020>\
**Category:** API Issues\
**Created:** [March 9, 2017, 6:13am UTC](http://forum.companieshouse.gov.uk/t/etag-not-in-header-of-company-profile/1020 "2017-03-09T06:13:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmw](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@dmw](http://forum.companieshouse.gov.uk/u/dmw)\
**Post date:** [March 9, 2017, 6:13am UTC](http://forum.companieshouse.gov.uk/t/etag-not-in-header-of-company-profile/1020/1 "2017-03-09T06:13:37Z")

</div>

According to the API documentation [here](https://developer.companieshouse.gov.uk/api/docs/company/company_number/readCompanyProfile.html), the Response header should include the etag. But when I look at the response headers, I do not see an etag, just this:

> Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0  
> Date: Thu, 09 Mar 2017 05:51:29 GMT  
> Pragma: no-cache  
> Content-Length: 1284  
> Content-Type: application/json  
> X-Ratelimit-Remain: 598  
> X-Ratelimit-Limit: 600  
> Access-Control-Expose-Headers: Location,www-authenticate,cache-control,pragma,content-type,expires,last-modified  
> X-Ratelimit-Reset: 1489038864

Instead, the etag is in the JSON body. Is the documentation wrong, or am I missing something?

---

<div class="post-metadata">

**Author:** ![voracityemail](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/v/b77776/32.png) [@voracityemail](http://forum.companieshouse.gov.uk/u/voracityemail)\
**Post date:** [March 9, 2017, 11:03am UTC](http://forum.companieshouse.gov.uk/t/etag-not-in-header-of-company-profile/1020/2 "2017-03-09T11:03:15Z")

</div>

See

> [@HEAD request not returning ETAG and/or Last-Modified](http://forum.aws.chdev.org/t/head-request-not-returning-etag-and-or-last-modified/493):
>
> We’re trying to build a mechanism that would only reach the CH API when the data has actually changed. One way of doing that would be to preflight the actual request with a HEAD request. Unfortunately there are no headers for Last-Modified or ETag stamps. I think such functionality would be very helpful to all. Is this something you guys could add?

> [@Etags in documentation, but not in resources](http://forum.aws.chdev.org/t/etags-in-documentation-but-not-in-resources/476):
>
> The documentation specifies that all resources should have etags, but I find that multiple resources that don’t e.g. Registered office Filing History Charges (here etags are exposed for every charge on its own, but not for the list) Is this something that is being worked on?

This seems to suggest the answer to your question is “documentation is incomplete / incorrect, but then the etag feature isn’t completed yet either”.

To quote from CH support (from Feb 2016):

> [@Etags in documentation, but not in resources](http://forum.aws.chdev.org/t/etags-in-documentation-but-not-in-resources/476/3):
>
> Ultimately, every resource will return an etag. As a client, if you make a request and supply an etag that you received previously, then the api will immediately tell you if the resource hasn’t changed, with no body obviously.

I believe this (with info from other article) means:

- The plan is to implement calling the API with an etag. Could be in the http header or as a parameter in the REST URI string.
- If CH find from your etag that the resource hasn’t changed, CH will let you know. Presumably they’d return a parameter in the header as they’ve stated “no body” - but maybe you’ll just get no “body” in response…
- If the resource has changed you get the resource in the body as you do now. The etag (always - I’ve not checked?) appears here.

For info, the documentation mentions an etag in the header for every REST call except:

- The various searches
- Registered Office Address
- Filing History
- Documents API (which is treated separately anyway).

The docs state that the etag mechanism will also apply to the constant files too:  
[https://developer.companieshouse.gov.uk/api/docs/index/gettingStarted.html#enumuration](https://developer.companieshouse.gov.uk/api/docs/index/gettingStarted.html#enumuration)
