You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2792 creates the input/output schemas needed to support the API. This ticket creates the API to read params from the request and send back extract metadata information.
Something like:
POST /v1/extracts/opportunities
Input:
ExtractMetadataRequestSchema
If extract_type is not provided, default to opportunity_data_extract (we may support more later)
If start_date and end_date not provided, default to where created_at is within the last 7 days.
Something like (rough pseudocode):
@opportunity_blueprint.post("/extracts/opportunities")
@opportunity_blueprint.output(extract_metadata_schemas.ExtractMetadataListResponseSchema)
@opportunity_blueprint.auth_required(api_key_auth)
@flask_db.with_db_session()
def extract_metadata_get(db_session: db.Session) -> ApiResponse:
# Get query parameters
# Default to last 7 days if no date range is provided
# Call service with params to get results
# Serialize results
# return ApiResponse(message="Success", data=metadata_list)
Acceptance criteria
API created with supporting service
Test to seed the db and read these values. Tests include parameter permutations
The text was updated successfully, but these errors were encountered:
We'll want to be careful about doing GET with a request body. It's fuzzy whether that's technically "right" in HTTP requests. Some libraries apparently won't let you do that. Either need everything to be request params or just make it a POST endpoint (I generally just prefer the latter).
I'm trying to think if we'll have more extracts in the future to warrant a naming schema like:
Related to 2454
Summary
2792 creates the input/output schemas needed to support the API. This ticket creates the API to read params from the request and send back extract metadata information.
Something like:
POST /v1/extracts/opportunities
Input:
ExtractMetadataRequestSchema
If
extract_type
is not provided, default toopportunity_data_extract
(we may support more later)If
start_date
andend_date
not provided, default to wherecreated_at
is within the last 7 days.Something like (rough pseudocode):
Acceptance criteria
The text was updated successfully, but these errors were encountered: