Skip to content
This repository was archived by the owner on Aug 27, 2021. It is now read-only.
This repository was archived by the owner on Aug 27, 2021. It is now read-only.

Undocumented "Link" response header #6413

@Jericho

Description

@Jericho

@kevinchalet and @jsgoupil recently brought to my attention that some endpoints in the SendGrid API return pagination information in a response header called Link. One example of such an endpoint is suppressions/unsubscribes which is the endpoint to retrieve all global suppressions. If you send a GET request to this endpoint, the response includes a Link header which contains information similar to this:

Link: 
    <https://api.sendgrid.com/v3/suppression/unsubscribes?limit=50&offset=50>; rel="next"; title="2",
    <https://api.sendgrid.com/v3/suppression/unsubscribes?limit=50&offset=0>; rel="prev"; title="1",
    <https://api.sendgrid.com/v3/suppression/unsubscribes?limit=50&offset=400>; rel="last"; title="9",
    <https://api.sendgrid.com/v3/suppression/unsubscribes?limit=50&offset=0>; rel="first"; title="1"

However, we noticed that this is not documented: https://sendgrid.api-docs.io/v3.0/suppressions-global-suppressions/retrieve-all-global-suppressions

I did a little bit more investigation and I found a few more endpoints that seem to also include this pagination information (this is probably not an exhaustive list, this is just what I found so far):

  • GET https://api.sendgrid.com/v3/user/webhooks/parse/settings
  • GET https://api.sendgrid.com/v3/teammates?limit=50&offset=0
  • GET https://api.sendgrid.com/v3/teammates/pending
  • GET https://api.sendgrid.com/v3/suppression/spam_reports?start_time=1577854800&end_time=1641013199&limit=25&offset=0
  • GET https://api.sendgrid.com/v3/whitelabel/links?limit=50&offset=0
  • GET https://api.sendgrid.com/v3/whitelabel/ips?limit=50&offset=0
  • GET https://api.sendgrid.com/v3/whitelabel/domains?exclude_subusers=false&limit=50&offset=0
  • GET https://api.sendgrid.com/v3/ips?exclude_whitelabels=False&limit=10&offset=0&sort_by_direction=asc
  • GET https://api.sendgrid.com/v3/api_keys

Questions

  1. Would it be possible to confirm if we can rely on this header for pagination information?
  2. Can you confirm which endpoints return this pagination information?
  3. We suspect the content of the header conforms to section 19.6.2.4 of RFC 2068 but can you please confirm?
  4. Will the documentation be updated to reflect this pagination information?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions