Courseiva
Data Acquisition and PreparationeasyMultiple ChoiceObjective-mapped

DA0-002 Data Acquisition and Preparation Practice Question

A data analyst is tasked with collecting data from a web API that returns JSON. The API requires an API key in the header. Which method should be used to authenticate?

⚠ Common exam trap

CompTIA often tests the distinction between authentication methods, and the trap here is that candidates may confuse storing credentials (Option C) with transmitting them, or think that query strings (Option D) are acceptable because they work technically, ignoring security and standard practices.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Add the API key in the HTTP header as 'Authorization: Bearer <key>'

The correct method is to include the API key in the HTTP header using the 'Authorization: Bearer <key>' format. This is the standard approach for token-based authentication in REST APIs, as defined by RFC 6750. It keeps the credential out of URLs and logs, and is the expected mechanism for API key authentication in modern web APIs.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Use a session cookie

    Why it's wrong here

    Session cookies are for web sessions, not API authentication.

  • Add the API key in the HTTP header as 'Authorization: Bearer <key>'

    Why this is correct

    Standard bearer token authentication is secure and widely used.

  • Store the API key in the database and reference it

    Why it's wrong here

    Storing the key is about management, not the method of sending it.

  • Include the API key in the URL query string

    Why it's wrong here

    Including the key in the URL is insecure and can be logged.

About these practice questions

This DA0-002 question is part of Courseiva's 986-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DA0-002 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DA0-002 exam.