diff options
Diffstat (limited to 'src/client/apis')
| -rw-r--r-- | src/client/apis/hypothesis/HypothesisApiUtils.ts | 13 | 
1 files changed, 13 insertions, 0 deletions
| diff --git a/src/client/apis/hypothesis/HypothesisApiUtils.ts b/src/client/apis/hypothesis/HypothesisApiUtils.ts new file mode 100644 index 000000000..714c9cdaf --- /dev/null +++ b/src/client/apis/hypothesis/HypothesisApiUtils.ts @@ -0,0 +1,13 @@ +export namespace Hypothesis { +    export const getAnnotation = async (username: String, searchParam: String) => { +        const base = 'https://api.hypothes.is/api/search'; +        const request = base + `?user=acct:${username}@hypothes.is&text=${searchParam}`; +        console.log("DASH Querying " + request); +        const response = await fetch(request); +        if (response.ok) { +            return response.json(); +        } else { +            throw new Error('DASH: Error in GET request'); +        } +    }; +}
\ No newline at end of file | 
