class GdsApi::PublishingApiV2
def get_expanded_links(content_id, with_drafts: true, generate: false)
- See: https://github.com/alphagov/publishing-api/blob/master/doc/api.md#get-v2expanded-linkscontent_id -
Parameters:
-
generate
(Bool
) -- Whether to require publishing-api to generate the expanded links, which may be slow. Defaults to `false`. -
with_drafts
(Bool
) -- Whether links to draft-only editions are returned, defaulting to `true`. -
content_id
(UUID
) --
def get_expanded_links(content_id, with_drafts: true, generate: false) params = {} params[:with_drafts] = "false" unless with_drafts params[:generate] = "true" if generate query = query_string(params) validate_content_id(content_id) get_json("#{endpoint}/v2/expanded-links/#{content_id}#{query}") end