-
Notifications
You must be signed in to change notification settings - Fork 0
Quickstart
Barnaby Alter edited this page Jan 22, 2018
·
3 revisions
In order to use the Salon application you need to be authorized by the Libraries Login OAuth2 application. Read the CONTRACT to learn more about it, or skip below for the TL;DR version.
#!/bin/sh
CLIENT_ID='{MY_ID}'
CLIENT_SECRET='{SHHHH}'
curl -X POST \
-d grant_type=client_credentials \
-d client_id=$CLIENT_ID \
-d client_secret=$CLIENT_SECRET \
https://dev.login.library.nyu.edu/oauth/token -v
{
"access_token": "ACCESS_TOKEN_FOR_THIS_SESSION",
"created_at": 1234567890,
"expires_in": 7200,
"token_type": "bearer"
}
Once you have the access token from Login, you can use that to access the API. Or use the examples below to create new empty resources:
#!/bin/sh
curl -H "Content-Type: application/json" \
-H "Authorization: Bearer ACCESS_TOKEN_FOR_THIS_SESSION" \
-X POST \
https://persistent.library.nyu.edu/create_empty_resource -v
{
"id": "NEWLY_MINTED_UNIQUE_ID"
}