class GdsApi::PublishingApi

def lookup_content_ids(base_paths:, exclude_document_types: nil, exclude_unpublishing_types: nil, with_drafts: false)

Other tags:
    See: https://github.com/alphagov/publishing-api/blob/master/doc/api.md#post-lookup-by-base-path -

Returns:
  • (Hash) - a hash, keyed by `base_path` with `content_id` as value

Parameters:
  • with_drafts (Boolean) -- (optional)
  • exclude_unpublishing_types (Array) -- (optional)
  • exclude_document_types (Array) -- (optional)
  • base_paths (Array) --
def lookup_content_ids(base_paths:, exclude_document_types: nil, exclude_unpublishing_types: nil, with_drafts: false)
  options = { base_paths: base_paths }
  options[:exclude_document_types] = exclude_document_types if exclude_document_types
  options[:exclude_unpublishing_types] = exclude_unpublishing_types if exclude_unpublishing_types
  options[:with_drafts] = with_drafts if with_drafts
  response = post_json("#{endpoint}/lookup-by-base-path", options)
  response.to_hash
end