Skip to content

Add more FDSH connection examples - #16

Open
neilmb wants to merge 7 commits into
mainfrom
nmb/bash-example
Open

Add more FDSH connection examples#16
neilmb wants to merge 7 commits into
mainfrom
nmb/bash-example

Conversation

@neilmb

@neilmb neilmb commented Aug 27, 2026

Copy link
Copy Markdown

Problem

FDSH API users want to see how to use connections in various programming languages.

This PR adds examples using the shell (via curl and jq) as well as Python (via the requests library).

Test Plan

Run the example code with

$ cd examples/
$ ./usage_example.sh

or for the Python example

$ cd examples/
$ python3 -m venv venv
$ . venv/bin/activate
$ pip install requests
$ python3 usage_example.py

@neilmb
neilmb requested a review from a team as a code owner August 27, 2026 19:42

@iannorriswork iannorriswork left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great first step!

return self._post(self.education_enrollment_path, {"nscRequest": payload})

@property
def access_token(self):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

food for thought: do we want to provide sample gateways smart enough to recover from expired tokens?

return self._token

@staticmethod
def _handle_response(response):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

food for thought: do we want to be giving people examples of how to build well-informed json structures instead of yolo blobbing?


Payload is a dictionary passed inside the nscRequest object, e.g.
{
"personGivenName": "Neil",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

food for thought: should we make the example a useful response isntead of a missing person named Neil haha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants