Skip to content

Params Documentation #122

Answered by jshcodes
Monstrosity8 asked this question in Q&A
Apr 6, 2021 · 2 comments · 5 replies
Discussion options

You must be logged in to vote

Here's an example I put together using the Detections API. Pretty much the same logic @CalebSchwartz demonstrates above, just expanded to show how you can adjust the paging.

"""
    pagination_example.py

    Created: 04.07.21, jshcodes@CrowdStrike

    This sample shows an example of iterating through a returned
    list of record ids using the pagination details provided by the
    CrowdStrike API in the meta branch of the response.
"""
import json
from falconpy import detects as FalconDetects


def create_payload(position: int, per_page: int) -> dict:
    """Create a properly formatted parameter payload"""
    payload = {}
    payload["offset"] = position
    payload["limit"] = per_page

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
5 replies
@Monstrosity8
Comment options

@jshcodes
Comment options

@Monstrosity8
Comment options

@CalebSchwartz
Comment options

@jshcodes
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by jshcodes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
API usage General API usage issues and questions
3 participants