Rest API Commands

The following commands may be given as JSON PUT requests to the SNAC RestFUL API. Most read-only API commands may be called without login, however anything that causes changes in the data require a user object which includes a temporary API key. For examples using the RestFUL API in PHP and Java, view the SNAC RestAPI Examples Repository on GitHub.

Search Vocabulary

Search through the controlled vocabulary.

Usage

Command:

vocabulary

Read Vocabulary Term

Read a particular controlled vocabulary term.

Usage

Command:

read_vocabulary

Reconcile Against SNAC

Reconcile a given constellation against all constellations in SNAC, returning the top results.

Usage

Command:

reconcile

Parameters:

constellation

Full Constellation object

Get User Information

Returns the information for the given user, including information for Constellations locked to the user.

Usage

Command:

user_information

Parameters:

user

User object

Insert New Constellation

Insert a new Constellation into SNAC. The Constellation must have the operation flags set to "insert".

Usage

Command:

insert_constellation

Parameters:

user

User object

constellation

Full Constellation object

Return Values:

constellation

Full Constellation object

Update Constellation

Updates SNAC's copy of the given Constellation with this one. Any components with operation flags set to "update" will be overwritten with the new version.

Usage

Command:

update_constellation

Parameters:

user

User object

constellation

Full Constellation object

Return Values:

constellation

Full Constellation object

Unlock Constellation

Drops the lock on the given Constellation from "currently editing" down to simply locked to the user.

Usage

Command:

unlock_constellation

Parameters:

user

User object

constellation

Full Constellation object

Return Values:

user

User object

Publish Constellation

Publishes the given Constellation in SNAC. This does not make any updates to the Constellation data in SNAC.

Usage

Command:

publish_constellation

Parameters:

user

User object

constellation

Full Constellation object

Return Values:

constellation

Full Constellation object

Send Constellation for Review

Sends the given Constellation in SNAC for review. This does not make any updates to the Constellation data in SNAC.

Usage

Command:

review_constellation

Parameters:

user

User object

constellation

Full Constellation object

Return Values:

constellation

Full Constellation object

Delete Constellation

Deletes the given Constellation from SNAC. This does not make any updates to the Constellation data in SNAC before deleting.

Usage

Command:

delete_constellation

Parameters:

user

User object

constellation

Full Constellation object

Return Values:

constellation

Full Constellation object

Reassign Constellation to Another User

Reassigns the given Constellation to a different user, i.e. changes which user to which the Constellation is locked. This does not make any updates to the Constellation data in SNAC.

Usage

Command:

reassign_constellation

Parameters:

user

User object

constellation

Full Constellation object

List Recently Published

Returns a list of the most recently published Constellations in SNAC.

Usage

Command:

recently_published

List Random Constellations

Returns a random subset of the Constellations in SNAC.

Usage

Command:

random_constellations

List Constellations

Returns a list of Constellations based on the query parameters.

Usage

Command:

list_constellations

Get Constellation History

Returns the edit history of the given Constellation.

Usage

Command:

constellation_history

Download Constellation

Returns the full Constellation in the requested format.

Usage

Command:

download_constellation

List Maybe-Same Constellations

Returns a list of Constellations denoted as maybe-same-as the given Constellation.

Usage

Command:

constellation_list_maybesame

Compute Constellation Diff

Computes the difference between the two given Constellations. Returns Constellation objects containing: only those items in the first, only those items in the second, and components shared.

Usage

Command:

constellation_diff

Parameters:

user

User object

constellationid1

Constellation ID for one Constellation to compare

constellationid2

Constellation ID for the other Constellation to compare

Return Values:

constellation1

Constellation object containing only data distinct to the first Constellation

constellation2

Constellation object containing only data distinct to the second Constellation

intersection

Constellation object containing only data shared by both Constellations

mergeable

Boolean value denoting whether these two Constellations can be merged by this user

Compute Constellation Diff and Set Merge

Computes the difference between the two given Constellations. Checks out the two Constellations in editing for the given user to allow a merge. Returns Constellation objects containing: only those items in the first, only those items in the second, and components shared.

Usage

Command:

constellation_diff_merge

Parameters:

user

User object

constellationid1

Constellation ID for one Constellation to compare

constellationid2

Constellation ID for the other Constellation to compare

Return Values:

constellation1

Constellation object containing only data distinct to the first Constellation

constellation2

Constellation object containing only data distinct to the second Constellation

intersection

Constellation object containing only data shared by both Constellations

mergeable

Boolean value denoting whether these two Constellations can be merged by this user

Merge Constellations

Given Constellation IDs and a full, merged, Constellation, creates a new Constellation in SNAC from the given Constellation and sets all Constellations given by the IDs to be "tombstoned" and redirected to the new, merged, Constellation.

Usage

Command:

constellation_merge

Parameters:

user

User object

constellationids

Array of Constellation IDs to tombstone in favor of the merged Constellation

constellation

Full Merged Constellation object

Return Values:

constellation

Full merged Constellation object with IDs

Automatically Merge Constellations

Given Constellation IDs, creates a new Constellation in SNAC from the combined data from all Constellations, "tombstones" the originals, and redirects thier IDs to the new, merged, Constellation.

Usage

Command:

constellation_auto_merge

Parameters:

user

User object

constellationids

Array of Constellation IDs to merge

Return Values:

constellation

Full merged Constellation object

Read Constellation

Returns the full Constellation for viewing.

Usage

Command:

read

Parameters:

constellationid

Constellation ID for Constellation to read

optional

arkid

ARK ID for Constellation to read

optional

version

Version of the Constellation to read

optional

Return Values:

constellation

Full Constellation object

Edit Constellation

Check out the Constellation for editing.

Usage

Command:

edit

Parameters:

user

User object

constellation

Constellation object with ID and version to edit

Return Values:

constellation

Full Constellation object checked out for editing

Search Constellations

Search for a Constellation, returning a list of possible matches.

Usage

Command:

search

Browse Constellations

Given a query name heading, returns the surrounding matching Constellations (in alphabetical order).

Usage

Command:

browse

Insert Resource

Given a Resource, inserts it into SNAC's resource cache.

Usage

Command:

insert_resource

Update Resource

Given a Resource, update the resource cache in SNAC by overwriting it with the given one.

Usage

Command:

update_resource

Read Resource

Read the entire Resource from SNAC's resource cache.

Usage

Command:

read_resource

Search Resources

Searches the resource cache in SNAC. Returns the top matches.

Usage

Command:

resource_search