Repository View API

A Collection of CRUD API endpoints used for interacting with CAP’s Repository View resource.

Create Repository View

A POST to the /repository-view endpoint which will result in the creation of a new Repository View in CAP.

Get All Repository Views

A GET to the /repository-view endpoint which will return a list all Repository Views in CAP.

Sample Request

GET /repository-view HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: localhost:8080

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 174

{
  "meta" : {
    "status" : "SUCCESS",
    "action" : null,
    "message" : "Your request was successful",
    "id" : null
  },
  "payload" : {
    "LinkedList" : [ ]
  }
}

Example Curl Request

$ curl 'http://localhost:8080/repository-view' -i -X GET \
    -H 'Content-Type: application/json;charset=UTF-8'

Update Repository View

A PUT request to the /repository-view endpoint which will result in the updating of the specified Repository View resource in CAP.

Sample Request

PUT /repository-view HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 240
Host: localhost:8080

{
  "id" : 1,
  "type" : "FEDORA",
  "name" : "TEST_REPOSITORY_VIEW_NAME_UPDATE",
  "rootUri" : "http://test-repository-view.org",
  "username" : null,
  "password" : null,
  "schemas" : [ ],
  "curators" : [ ],
  "metadataPrefixes" : [ ]
}

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 336

{
  "meta" : {
    "status" : "INVALID",
    "action" : null,
    "message" : "Your request failed validation",
    "id" : null
  },
  "payload" : {
    "ValidationResults" : {
      "valid" : false,
      "messages" : {
        "business" : {
          "UPDATE" : "RepositoryView with id 1 does not exist"
        }
      }
    }
  }
}

Example Curl Request

$ curl 'http://localhost:8080/repository-view' -i -X PUT \
    -H 'Content-Type: application/json;charset=UTF-8' \
    -d '{
  "id" : 1,
  "type" : "FEDORA",
  "name" : "TEST_REPOSITORY_VIEW_NAME_UPDATE",
  "rootUri" : "http://test-repository-view.org",
  "username" : null,
  "password" : null,
  "schemas" : [ ],
  "curators" : [ ],
  "metadataPrefixes" : [ ]
}'

Delete Repository View

A DELETE request to the /repository-view endpoint which will result in the deletion of the specified Repository View resource in CAP.

Get Repository View

A GET request to the /repository-view/{id} endpoint which will result in the retrieval of the specified Repository View resource in CAP.

Get Repository View Types

A GET request to the /repository-view/types endpoint which will result in the retrieval of a list of all Repository View Types supported by CAP.

Repository View Context API

A Collection of CRUD API endpoints used for interacting with CAP’s Repository View Context resource.

Get Repository View Context

A GET request to the /repository-view-context/{type}/{repositoryViewId}?contexturi={contextUri} endpoint, where contextUri will equal resource within the designated repository. This will result in the rendering of the specified resource as a Repository View Context.

Path Parameters

Table 1. /repository-view-context/{type}/{repositoryViewId}
Parameter Description

type

The type of the Repository view to be rendered as a Repository View Context.

repositoryViewId

The id of the Repository view to be rendered as a Repository View Context.

Request Parameters

Parameter Description

contextUri

The URI resource within the designated repository.

Sample Request

GET /repository-view-context/FEDORA/1?contextUri=http%3A%2F%2Fexample.com HTTP/1.1
Host: localhost:8080

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 516

{
  "meta" : {
    "status" : "SUCCESS",
    "action" : null,
    "message" : "Your request was successful",
    "id" : null
  },
  "payload" : {
    "RepositoryViewContext" : {
      "name" : null,
      "triple" : null,
      "parent" : null,
      "properties" : [ ],
      "metadata" : [ ],
      "children" : [ ],
      "versions" : [ ],
      "version" : null,
      "transactionDetails" : null,
      "features" : { },
      "resource" : false,
      "isVersion" : false,
      "hasParent" : false
    }
  }
}

Example Curl Request

$ curl 'http://localhost:8080/repository-view-context/FEDORA/1?contextUri=http%3A%2F%2Fexample.com' -i -X GET

Delete Repository View Context

A DELETE request to the /repository-view-context/{type}/{repositoryViewId}?contexturi={contextUri} endpoint, where contextUri will equal resource within the designated repository. This will result in the deletion of the specified resource as a Repository View Context.

Path Parameters

Table 2. /repository-view-context/{type}/{repositoryViewId}
Parameter Description

type

The type of the Repository view to be rendered as a Repository View Context.

repositoryViewId

The id of the Repository view to be rendered as a Repository View Context.

Request Parameters

Parameter Description

contextUri

The URI resource within the designated repository.

Sample Request

DELETE /repository-view-context/FEDORA/1?contextUri=http%3A%2F%2Fexample.com HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 229
Host: localhost:8080

{
  "id" : 1,
  "type" : "FEDORA",
  "name" : "TEST_REPOSITORY_VIEW_NAME",
  "rootUri" : "http://test-repository-view.org",
  "username" : "",
  "password" : "",
  "schemas" : [ ],
  "curators" : [ ],
  "metadataPrefixes" : [ ]
}

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 149

{
  "meta" : {
    "status" : "SUCCESS",
    "action" : null,
    "message" : "Your request was successful",
    "id" : null
  },
  "payload" : { }
}

Example Curl Request

$ curl 'http://localhost:8080/repository-view-context/FEDORA/1?contextUri=http%3A%2F%2Fexample.com' -i -X DELETE \
    -H 'Content-Type: application/json;charset=UTF-8' \
    -d '{
  "id" : 1,
  "type" : "FEDORA",
  "name" : "TEST_REPOSITORY_VIEW_NAME",
  "rootUri" : "http://test-repository-view.org",
  "username" : "",
  "password" : "",
  "schemas" : [ ],
  "curators" : [ ],
  "metadataPrefixes" : [ ]
}'

Get Triples

A GET request to the /repository-view-context/{type}/{repositoryViewId}/triples?contexturi={contextUri} endpoint, where contextUri will equal resource within the designated repository. This will result in the rendering of all triples for the specified resource as a Repository View Context.

Path Parameters

Table 3. /repository-view-context/{type}/{repositoryViewId}/triples
Parameter Description

type

The type of the Repository view to be rendered as a Repository View Context.

repositoryViewId

The id of the Repository view to be rendered as a Repository View Context.

Request Parameters

Parameter Description

contextUri

The URI resource within the designated repository.

Sample Request

GET /repository-view-context/FEDORA/1/triples?contextUri=http%3A%2F%2Fexample.com HTTP/1.1
Host: localhost:8080

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 289

{
  "meta" : {
    "status" : "SUCCESS",
    "action" : null,
    "message" : "Your request was successful",
    "id" : null
  },
  "payload" : {
    "ArrayList<Triple>" : [ {
      "subject" : "TestSubject",
      "predicate" : "TestPredicate",
      "object" : "TestObject"
    } ]
  }
}

Example Curl Request

$ curl 'http://localhost:8080/repository-view-context/FEDORA/1/triples?contextUri=http%3A%2F%2Fexample.com' -i -X GET

Repository View Context Children API

A Collection of CRUD API endpoints used for interacting with CAP’s Repository View Context Children resource.

Create

A POST request to the /repository-view-context/{type}/{repositoryViewId}/children?contexturi={contextUri} endpoint, where contextUri will equal resource within the designated repository. This will result in adding a Triple as a Child to the Repository View Context.

Path Parameters

Table 4. /repository-view-context/{type}/{repositoryViewId}/children
Parameter Description

type

The type of the Repository view to be rendered as a Repository View Context.

repositoryViewId

The id of the Repository view to be rendered as a Repository View Context.

Request Parameters

Parameter Description

contextUri

The URI resource within the designated repository.

Sample Request

POST /repository-view-context/FEDORA/1/children?contextUri=http%3A%2F%2Fexample.com HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 95
Host: localhost:8080

[ {
  "predicate" : "TestPredicate",
  "subject" : "TestSubject",
  "object" : "TestObject"
} ]

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 516

{
  "meta" : {
    "status" : "SUCCESS",
    "action" : null,
    "message" : "Your request was successful",
    "id" : null
  },
  "payload" : {
    "RepositoryViewContext" : {
      "name" : null,
      "triple" : null,
      "parent" : null,
      "properties" : [ ],
      "metadata" : [ ],
      "children" : [ ],
      "versions" : [ ],
      "version" : null,
      "transactionDetails" : null,
      "features" : { },
      "resource" : false,
      "isVersion" : false,
      "hasParent" : false
    }
  }
}

Example Curl Request

$ curl 'http://localhost:8080/repository-view-context/FEDORA/1/children?contextUri=http%3A%2F%2Fexample.com' -i -X POST \
    -H 'Content-Type: application/json;charset=UTF-8' \
    -d '[ {
  "predicate" : "TestPredicate",
  "subject" : "TestSubject",
  "object" : "TestObject"
} ]'

Get Container

A GET request to the /repository-view-context/{type}/{repositoryViewId}/children?contexturi={contextUri} endpoint, where contextUri will equal resource within the designated repository. This will result in rendering Repository View Context Children Triples.

Path Parameters

Table 5. /repository-view-context/{type}/{repositoryViewId}/children
Parameter Description

type

The type of the Repository view to be rendered as a Repository View Context.

repositoryViewId

The id of the Repository view to be rendered as a Repository View Context.

Request Parameters

Parameter Description

contextUri

The URI resource within the designated repository.

Sample Request

GET /repository-view-context/FEDORA/1/children?contextUri=http%3A%2F%2Fexample.com HTTP/1.1
Host: localhost:8080

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 289

{
  "meta" : {
    "status" : "SUCCESS",
    "action" : null,
    "message" : "Your request was successful",
    "id" : null
  },
  "payload" : {
    "ArrayList<Triple>" : [ {
      "subject" : "TestSubject",
      "predicate" : "TestPredicate",
      "object" : "TestObject"
    } ]
  }
}

Example Curl Request

$ curl 'http://localhost:8080/repository-view-context/FEDORA/1/children?contextUri=http%3A%2F%2Fexample.com' -i -X GET

Repository View Metadata Children API

A Collection of CRUD API endpoints used for interacting with CAP’s Repository View Context Metadata resource.

Create Metadata

A POST request to the /repository-view-context/{type}/{repositoryViewId}/metadata?contexturi={contextUri} endpoint, where contextUri will equal resource within the designated repository. This will result in the creation of the specified resource as a Repository View Context Metadata.

Path Parameters

Table 6. /repository-view-context/{type}/{repositoryViewId}/metadata
Parameter Description

type

The type of the Repository view to be rendered as a Repository View Context.

repositoryViewId

The id of the Repository view to be rendered as a Repository View Context.

Request Parameters

Parameter Description

contextUri

The URI resource within the designated repository.

Sample Request

POST /repository-view-context/FEDORA/1/metadata?contextUri=http%3A%2F%2Fexample.com HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 91
Host: localhost:8080

{
  "subject" : "TestSubject",
  "predicate" : "TestPredicate",
  "object" : "TestObject"
}

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 516

{
  "meta" : {
    "status" : "SUCCESS",
    "action" : null,
    "message" : "Your request was successful",
    "id" : null
  },
  "payload" : {
    "RepositoryViewContext" : {
      "name" : null,
      "triple" : null,
      "parent" : null,
      "properties" : [ ],
      "metadata" : [ ],
      "children" : [ ],
      "versions" : [ ],
      "version" : null,
      "transactionDetails" : null,
      "features" : { },
      "resource" : false,
      "isVersion" : false,
      "hasParent" : false
    }
  }
}

Example Curl Request

$ curl 'http://localhost:8080/repository-view-context/FEDORA/1/metadata?contextUri=http%3A%2F%2Fexample.com' -i -X POST \
    -H 'Content-Type: application/json;charset=UTF-8' \
    -d '{
  "subject" : "TestSubject",
  "predicate" : "TestPredicate",
  "object" : "TestObject"
}'

Get Metadata

A GET request to the /repository-view-context/{type}/{repositoryViewId}/metadata?contexturi={contextUri} endpoint, where contextUri will equal resource within the designated repository. This will result in the rendering of the specified resource as a Repository View Context Metadata.

Path Parameters

Table 7. /repository-view-context/{type}/{repositoryViewId}/metadata
Parameter Description

type

The type of the Repository view to be rendered as a Repository View Context.

repositoryViewId

The id of the Repository view to be rendered as a Repository View Context.

Request Parameters

Parameter Description

contextUri

The URI resource within the designated repository.

Sample Request

GET /repository-view-context/FEDORA/1/metadata?contextUri=http%3A%2F%2Fexample.com HTTP/1.1
Host: localhost:8080

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 289

{
  "meta" : {
    "status" : "SUCCESS",
    "action" : null,
    "message" : "Your request was successful",
    "id" : null
  },
  "payload" : {
    "ArrayList<Triple>" : [ {
      "subject" : "TestSubject",
      "predicate" : "TestPredicate",
      "object" : "TestObject"
    } ]
  }
}

Example Curl Request

$ curl 'http://localhost:8080/repository-view-context/FEDORA/1/metadata?contextUri=http%3A%2F%2Fexample.com' -i -X GET

Update Metadata

A PUT request to the /repository-view-context/{type}/{repositoryViewId}/metadata?contexturi={contextUri} endpoint, where contextUri will equal resource within the designated repository. This will result in updating the specified resource as a Repository View Context Metadata.

Path Parameters

Table 8. /repository-view-context/{type}/{repositoryViewId}/metadata
Parameter Description

type

The type of the Repository view to be rendered as a Repository View Context.

repositoryViewId

The id of the Repository view to be rendered as a Repository View Context.

Request Parameters

Parameter Description

contextUri

The URI resource within the designated repository.

value

The new value to assign.

Sample Request

PUT /repository-view-context/FEDORA/1/metadata?contextUri=http%3A%2F%2Fexample.com&value= HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 91
Host: localhost:8080

{
  "subject" : "TestSubject",
  "predicate" : "TestPredicate",
  "object" : "TestObject"
}

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 516

{
  "meta" : {
    "status" : "SUCCESS",
    "action" : null,
    "message" : "Your request was successful",
    "id" : null
  },
  "payload" : {
    "RepositoryViewContext" : {
      "name" : null,
      "triple" : null,
      "parent" : null,
      "properties" : [ ],
      "metadata" : [ ],
      "children" : [ ],
      "versions" : [ ],
      "version" : null,
      "transactionDetails" : null,
      "features" : { },
      "resource" : false,
      "isVersion" : false,
      "hasParent" : false
    }
  }
}

Example Curl Request

$ curl 'http://localhost:8080/repository-view-context/FEDORA/1/metadata?contextUri=http%3A%2F%2Fexample.com&value=' -i -X PUT \
    -H 'Content-Type: application/json;charset=UTF-8' \
    -d '{
  "subject" : "TestSubject",
  "predicate" : "TestPredicate",
  "object" : "TestObject"
}'

Delete Metadata

A DELETE request to the /repository-view-context/{type}/{repositoryViewId}/metadata?contexturi={contextUri} endpoint, where contextUri will equal resource within the designated repository. This will result in the deletion of the specified resource as a Repository View Context Metadata.

Path Parameters

Table 9. /repository-view-context/{type}/{repositoryViewId}/metadata
Parameter Description

type

The type of the Repository view to be rendered as a Repository View Context.

repositoryViewId

The id of the Repository view to be rendered as a Repository View Context.

Request Parameters

Parameter Description

contextUri

The URI resource within the designated repository.

Sample Request

DELETE /repository-view-context/FEDORA/1/metadata?contextUri=http%3A%2F%2Fexample.com HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 91
Host: localhost:8080

{
  "subject" : "TestSubject",
  "predicate" : "TestPredicate",
  "object" : "TestObject"
}

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 516

{
  "meta" : {
    "status" : "SUCCESS",
    "action" : null,
    "message" : "Your request was successful",
    "id" : null
  },
  "payload" : {
    "RepositoryViewContext" : {
      "name" : null,
      "triple" : null,
      "parent" : null,
      "properties" : [ ],
      "metadata" : [ ],
      "children" : [ ],
      "versions" : [ ],
      "version" : null,
      "transactionDetails" : null,
      "features" : { },
      "resource" : false,
      "isVersion" : false,
      "hasParent" : false
    }
  }
}

Example Curl Request

$ curl 'http://localhost:8080/repository-view-context/FEDORA/1/metadata?contextUri=http%3A%2F%2Fexample.com' -i -X DELETE \
    -H 'Content-Type: application/json;charset=UTF-8' \
    -d '{
  "subject" : "TestSubject",
  "predicate" : "TestPredicate",
  "object" : "TestObject"
}'

Repository View Context Query API

A Collection of CRUD API endpoints used for interacting with CAP’s Repository View Context Query resource.

Make Query

A POST request to the /repository-view-context/{type}/{repositoryViewId}/query?contexturi={contextUri} endpoint, where contextUri will equal resource within the designated repository. This will result in the execution of the provided query.

Path Parameters

Table 10. /repository-view-context/{type}/{repositoryViewId}/query
Parameter Description

type

The type of the Repository view to be rendered as a Repository View Context.

repositoryViewId

The id of the Repository view to be rendered as a Repository View Context.

Request Parameters

Parameter Description

contextUri

The URI resource within the designated repository.

Sample Request

POST /repository-view-context/FEDORA/1/query?contextUri=http%3A%2F%2Fexample.com HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 12
Host: localhost:8080

"test query"

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 516

{
  "meta" : {
    "status" : "SUCCESS",
    "action" : null,
    "message" : "Your request was successful",
    "id" : null
  },
  "payload" : {
    "RepositoryViewContext" : {
      "name" : null,
      "triple" : null,
      "parent" : null,
      "properties" : [ ],
      "metadata" : [ ],
      "children" : [ ],
      "versions" : [ ],
      "version" : null,
      "transactionDetails" : null,
      "features" : { },
      "resource" : false,
      "isVersion" : false,
      "hasParent" : false
    }
  }
}

Example Curl Request

$ curl 'http://localhost:8080/repository-view-context/FEDORA/1/query?contextUri=http%3A%2F%2Fexample.com' -i -X POST \
    -H 'Content-Type: application/json;charset=UTF-8' \
    -d '"test query"'

Get Query Help

A GET request to the /repository-view-context/{type}/{repositoryViewId}/query?contexturi={contextUri} endpoint, where contextUri will equal resource within the designated repository. This will provide help on executing a query.

Path Parameters

Table 11. /repository-view-context/{type}/{repositoryViewId}/query
Parameter Description

type

The type of the Repository view to be rendered as a Repository View Context.

repositoryViewId

The id of the Repository view to be rendered as a Repository View Context.

Request Parameters

Parameter Description

contextUri

The URI resource within the designated repository.

Sample Request

GET /repository-view-context/FEDORA/1/query?contextUri=http%3A%2F%2Fexample.com HTTP/1.1
Host: localhost:8080

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 248

{
  "meta" : {
    "status" : "SUCCESS",
    "action" : null,
    "message" : "Successfully retrieved query help.",
    "id" : null
  },
  "payload" : {
    "String" : "PREFIX tst: <http://test.com/#>\n\nDELETE { }\nINSERT { }\nWHERE { }\n\n"
  }
}

Example Curl Request

$ curl 'http://localhost:8080/repository-view-context/FEDORA/1/query?contextUri=http%3A%2F%2Fexample.com' -i -X GET

Repository View Context Resource API

A Collection of CRUD API endpoints used for interacting with CAP’s Repository View Context Resource resource.

Create Resource

A multipart POST request to the /repository-view-context/{type}/{repositoryViewId}/resource?contexturi={contextUri} endpoint, where contextUri will equal resource within the designated repository. This will result in saving the uploaded Resource.

Path Parameters

Table 12. /repository-view-context/{type}/{repositoryViewId}/resource
Parameter Description

type

The type of the Repository view to be rendered as a Repository View Context.

repositoryViewId

The id of the Repository view to be rendered as a Repository View Context.

Request Parameters

Parameter Description

contextUri

The URI resource within the designated repository.

Sample Request

POST /repository-view-context/FEDORA/1/resource HTTP/1.1
Content-Type: multipart/form-data;charset=UTF-8; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Host: localhost:8080

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=contextUri

http://example.com
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=file; filename=mock_file.txt
Content-Type: text/plain

mock data
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 516

{
  "meta" : {
    "status" : "SUCCESS",
    "action" : null,
    "message" : "Your request was successful",
    "id" : null
  },
  "payload" : {
    "RepositoryViewContext" : {
      "name" : null,
      "triple" : null,
      "parent" : null,
      "properties" : [ ],
      "metadata" : [ ],
      "children" : [ ],
      "versions" : [ ],
      "version" : null,
      "transactionDetails" : null,
      "features" : { },
      "resource" : false,
      "isVersion" : false,
      "hasParent" : false
    }
  }
}

Example Curl Request

$ curl 'http://localhost:8080/repository-view-context/FEDORA/1/resource' -i -X POST \
    -H 'Content-Type: multipart/form-data;charset=UTF-8' \
    -F 'file=@mock_file.txt;type=text/plain' \
    -F 'contextUri=http://example.com'

Get Resources

A GET request to the /repository-view-context/{type}/{repositoryViewId}/resource?contexturi={contextUri} endpoint, where contextUri will equal resource within the designated repository. This will result in the rendering of the specified resource as a Repository View Context Resource.

Path Parameters

Table 13. /repository-view-context/{type}/{repositoryViewId}/resource
Parameter Description

type

The type of the Repository view to be rendered as a Repository View Context.

repositoryViewId

The id of the Repository view to be rendered as a Repository View Context.

Request Parameters

Parameter Description

contextUri

The URI resource within the designated repository.

Sample Request

GET /repository-view-context/FEDORA/1/resource?contextUri=http%3A%2F%2Fexample.com HTTP/1.1
Host: localhost:8080

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 516

{
  "meta" : {
    "status" : "SUCCESS",
    "action" : null,
    "message" : "Your request was successful",
    "id" : null
  },
  "payload" : {
    "RepositoryViewContext" : {
      "name" : null,
      "triple" : null,
      "parent" : null,
      "properties" : [ ],
      "metadata" : [ ],
      "children" : [ ],
      "versions" : [ ],
      "version" : null,
      "transactionDetails" : null,
      "features" : { },
      "resource" : false,
      "isVersion" : false,
      "hasParent" : false
    }
  }
}

Example Curl Request

$ curl 'http://localhost:8080/repository-view-context/FEDORA/1/resource?contextUri=http%3A%2F%2Fexample.com' -i -X GET

Delete Resources

A DELETE request to the /repository-view-context/{type}/{repositoryViewId}/resource?contexturi={contextUri} endpoint, where contextUri will equal resource within the designated repository. This will result in the deletion of the specified resource as a Repository View Context Resource.

Path Parameters

Table 14. /repository-view-context/{type}/{repositoryViewId}/resource
Parameter Description

type

The type of the Repository view to be rendered as a Repository View Context.

repositoryViewId

The id of the Repository view to be rendered as a Repository View Context.

Request Parameters

Parameter Description

contextUri

The URI resource within the designated repository.

Sample Request

DELETE /repository-view-context/FEDORA/1/resource?contextUri=http%3A%2F%2Fexample.com HTTP/1.1
Host: localhost:8080

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 149

{
  "meta" : {
    "status" : "SUCCESS",
    "action" : null,
    "message" : "Your request was successful",
    "id" : null
  },
  "payload" : { }
}

Example Curl Request

$ curl 'http://localhost:8080/repository-view-context/FEDORA/1/resource?contextUri=http%3A%2F%2Fexample.com' -i -X DELETE

Check Fixity

A GET request to the /repository-view-context/{type}/{repositoryViewId}/resource/fixity?contexturi={contextUri} endpoint, where contextUri will equal resource within the designated repository. This will result in the execution of fixity for the specified resource as a Repository View Context Resource.

Path Parameters

Table 15. /repository-view-context/{type}/{repositoryViewId}/resource/fixity
Parameter Description

type

The type of the Repository view to be rendered as a Repository View Context.

repositoryViewId

The id of the Repository view to be rendered as a Repository View Context.

Request Parameters

Parameter Description

contextUri

The URI resource within the designated repository.

Sample Request

GET /repository-view-context/FEDORA/1/resource/fixity?contextUri=http%3A%2F%2Fexample.com HTTP/1.1
Host: localhost:8080

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 286

{
  "meta" : {
    "status" : "SUCCESS",
    "action" : null,
    "message" : "Your request was successful",
    "id" : null
  },
  "payload" : {
    "FixityReport" : {
      "status" : "Test Status",
      "messageDigest" : "Test Message Digest",
      "size" : "Test Size"
    }
  }
}

Example Curl Request

$ curl 'http://localhost:8080/repository-view-context/FEDORA/1/resource/fixity?contextUri=http%3A%2F%2Fexample.com' -i -X GET

Repository View Context Transaction API

A Collection of CRUD API endpoints used for interacting with CAP’s Repository View Context Transaction resource.

Start Transaction

A GET request to the /repository-view-context/{type}/{repositoryViewId}/transaction endpoint. This will result in the creation of a Repository View Context Transaction.

Path Parameters

Table 16. /repository-view-context/{type}/{repositoryViewId}/transaction
Parameter Description

type

The Repository View type name.

repositoryViewId

The Repository View identifier.

Sample Request

GET /repository-view-context/FEDORA/1/transaction HTTP/1.1
Host: localhost:8080

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 255

{
  "meta" : {
    "status" : "SUCCESS",
    "action" : null,
    "message" : "Transaction successfully created",
    "id" : null
  },
  "payload" : {
    "TransactionDetails" : {
      "token" : "testToken",
      "expiration" : 1720792866219
    }
  }
}

Example Curl Request

$ curl 'http://localhost:8080/repository-view-context/FEDORA/1/transaction' -i -X GET

Rollback Transaction

A DELETE request to the /repository-view-context/{type}/{repositoryViewId}/transaction?contexturi={contextUri} endpoint, where contextUri will equal resource within the designated repository. This will result in rolling back all changes in a Repository View Context Transaction.

Path Parameters

Table 17. /repository-view-context/{type}/{repositoryViewId}/transaction
Parameter Description

type

The Repository View type name.

repositoryViewId

The Repository View identifier.

Request Parameters

Parameter Description

contextUri

The URI resource within the designated repository.

Sample Request

DELETE /repository-view-context/FEDORA/1/transaction?contextUri=http%3A%2F%2Fexample.com%3Ftoken%3Dtx%3AtestToken HTTP/1.1
Host: localhost:8080

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 154

{
  "meta" : {
    "status" : "SUCCESS",
    "action" : null,
    "message" : "Transaction successfully created",
    "id" : null
  },
  "payload" : { }
}

Example Curl Request

$ curl 'http://localhost:8080/repository-view-context/FEDORA/1/transaction?contextUri=http%3A%2F%2Fexample.com%3Ftoken%3Dtx%3AtestToken' -i -X DELETE

Refresh Transaction

A PUT request to the /repository-view-context/{type}/{repositoryViewId}/transaction?contexturi={contextUri} endpoint, where contextUri will equal resource within the designated repository. This will update the Repository View Context Transaction status.

Path Parameters

Table 18. /repository-view-context/{type}/{repositoryViewId}/transaction
Parameter Description

type

The Repository View type name.

repositoryViewId

The Repository View identifier.

Sample Request

PUT /repository-view-context/FEDORA/1/transaction HTTP/1.1
Host: localhost:8080
Content-Type: application/x-www-form-urlencoded

contextUri=http%3A%2F%2Fexample.com%3Ftoken%3Dtx%3AtestToken

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 255

{
  "meta" : {
    "status" : "SUCCESS",
    "action" : null,
    "message" : "Transaction successfully created",
    "id" : null
  },
  "payload" : {
    "TransactionDetails" : {
      "token" : "testToken",
      "expiration" : 1720792866174
    }
  }
}

Example Curl Request

$ curl 'http://localhost:8080/repository-view-context/FEDORA/1/transaction' -i -X PUT \
    -d 'contextUri=http%3A%2F%2Fexample.com%3Ftoken%3Dtx%3AtestToken'

Repository View Context Version API

A Collection of CRUD API endpoints used for interacting with CAP’s Repository View Version resource.

Create Version

A POST request to the /repository-view-context/{type}/{repositoryViewId}/version?contexturi={contextUri} endpoint, where contextUri will equal resource within the designated repository. This will result in creating a specified version of a Repository View Context.

Restore Version

A PATCH request to the /repository-view-context/{type}/{repositoryViewId}/version?contexturi={contextUri} endpoint, where contextUri will equal resource within the designated repository. This will result in restoring a specified version of a Repository View Context.

Path Parameters

Table 19. /repository-view-context/{type}/{repositoryViewId}/version
Parameter Description

type

The type of the Repository view to be rendered as a Repository View Context.

repositoryViewId

The id of the Repository view to be rendered as a Repository View Context.

Request Parameters

Parameter Description

contextUri

The URI resource within the designated repository.

Sample Request

PATCH /repository-view-context/FEDORA/1/version?contextUri=http%3A%2F%2Fexample.com HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 229
Host: localhost:8080

{
  "id" : 1,
  "type" : "FEDORA",
  "name" : "TEST_REPOSITORY_VIEW_NAME",
  "rootUri" : "http://test-repository-view.org",
  "username" : "",
  "password" : "",
  "schemas" : [ ],
  "curators" : [ ],
  "metadataPrefixes" : [ ]
}

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 516

{
  "meta" : {
    "status" : "SUCCESS",
    "action" : null,
    "message" : "Your request was successful",
    "id" : null
  },
  "payload" : {
    "RepositoryViewContext" : {
      "name" : null,
      "triple" : null,
      "parent" : null,
      "properties" : [ ],
      "metadata" : [ ],
      "children" : [ ],
      "versions" : [ ],
      "version" : null,
      "transactionDetails" : null,
      "features" : { },
      "resource" : false,
      "isVersion" : false,
      "hasParent" : false
    }
  }
}

Example Curl Request

$ curl 'http://localhost:8080/repository-view-context/FEDORA/1/version?contextUri=http%3A%2F%2Fexample.com' -i -X PATCH \
    -H 'Content-Type: application/json;charset=UTF-8' \
    -d '{
  "id" : 1,
  "type" : "FEDORA",
  "name" : "TEST_REPOSITORY_VIEW_NAME",
  "rootUri" : "http://test-repository-view.org",
  "username" : "",
  "password" : "",
  "schemas" : [ ],
  "curators" : [ ],
  "metadataPrefixes" : [ ]
}'

Delete Version

A DELETE request to the /repository-view-context/{type}/{repositoryViewId}/version?contexturi={contextUri} endpoint, where contextUri will equal resource within the designated repository. This will resultin deleting a specified version of a Repository View Context.

Path Parameters

Table 20. /repository-view-context/{type}/{repositoryViewId}/version
Parameter Description

type

The type of the Repository view to be rendered as a Repository View Context.

repositoryViewId

The id of the Repository view to be rendered as a Repository View Context.

Request Parameters

Parameter Description

contextUri

The URI resource within the designated repository.

Sample Request

DELETE /repository-view-context/FEDORA/1/version?contextUri=http%3A%2F%2Fexample.com HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 229
Host: localhost:8080

{
  "id" : 1,
  "type" : "FEDORA",
  "name" : "TEST_REPOSITORY_VIEW_NAME",
  "rootUri" : "http://test-repository-view.org",
  "username" : "",
  "password" : "",
  "schemas" : [ ],
  "curators" : [ ],
  "metadataPrefixes" : [ ]
}

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 149

{
  "meta" : {
    "status" : "SUCCESS",
    "action" : null,
    "message" : "Your request was successful",
    "id" : null
  },
  "payload" : { }
}

Example Curl Request

$ curl 'http://localhost:8080/repository-view-context/FEDORA/1/version?contextUri=http%3A%2F%2Fexample.com' -i -X DELETE \
    -H 'Content-Type: application/json;charset=UTF-8' \
    -d '{
  "id" : 1,
  "type" : "FEDORA",
  "name" : "TEST_REPOSITORY_VIEW_NAME",
  "rootUri" : "http://test-repository-view.org",
  "username" : "",
  "password" : "",
  "schemas" : [ ],
  "curators" : [ ],
  "metadataPrefixes" : [ ]
}'

Schema API

A Collection of CRUD API endpoints used for interacting with CAP’s Schema resource.

Create Schema

A POST to the /schema endpoint which will register the specified schema with CAP.

Request Fields

Path Type Description

name

String

Schema name

abbreviation

String

Schema abbreviation

namespace

String

Schema namespace

properties

Array

Schema properties

namespaces

Array

Included namespaces

Sample Request

POST /schema HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 437
Host: localhost:8080

{
  "id" : null,
  "name" : "TEST_SCHEMA",
  "abbreviation" : "TS",
  "namespace" : "http://test-schema-location.org",
  "properties" : [ {
    "uri" : "http://test-property-uri.org/ns/property1",
    "label" : "TEST_PROPERTY_LABEL"
  }, {
    "uri" : "http://test-property-2-uri.org/ns/property2",
    "label" : "TEST_PROPERTY_LABEL_2"
  } ],
  "namespaces" : [ "http://test-property-2-uri.org/ns", "http://test-property-uri.org/ns" ]
}

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 653

{
  "meta" : {
    "status" : "SUCCESS",
    "action" : null,
    "message" : "Your request was successful",
    "id" : null
  },
  "payload" : {
    "Schema" : {
      "id" : 6,
      "name" : "TEST_SCHEMA",
      "abbreviation" : "TS",
      "namespace" : "http://test-schema-location.org",
      "properties" : [ {
        "uri" : "http://test-property-uri.org/ns/property1",
        "label" : "TEST_PROPERTY_LABEL"
      }, {
        "uri" : "http://test-property-2-uri.org/ns/property2",
        "label" : "TEST_PROPERTY_LABEL_2"
      } ],
      "namespaces" : [ "http://test-property-2-uri.org/ns", "http://test-property-uri.org/ns" ]
    }
  }
}

Example Curl Request

$ curl 'http://localhost:8080/schema' -i -X POST \
    -H 'Content-Type: application/json;charset=UTF-8' \
    -d '{
  "id" : null,
  "name" : "TEST_SCHEMA",
  "abbreviation" : "TS",
  "namespace" : "http://test-schema-location.org",
  "properties" : [ {
    "uri" : "http://test-property-uri.org/ns/property1",
    "label" : "TEST_PROPERTY_LABEL"
  }, {
    "uri" : "http://test-property-2-uri.org/ns/property2",
    "label" : "TEST_PROPERTY_LABEL_2"
  } ],
  "namespaces" : [ "http://test-property-2-uri.org/ns", "http://test-property-uri.org/ns" ]
}'

Get All Schemas

A GET request to the /schema endpoint which will result in a list of all schemas registered with CAP.

Sample Request

GET /schema HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: localhost:8080

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 565

{
  "meta" : {
    "status" : "SUCCESS",
    "action" : null,
    "message" : "Your request was successful",
    "id" : null
  },
  "payload" : {
    "ArrayList<Schema>" : [ {
      "id" : 1,
      "name" : "TEST_SCHEMA",
      "abbreviation" : "TS",
      "namespace" : "http://test-schema-location.org",
      "properties" : [ ],
      "namespaces" : [ ]
    }, {
      "id" : 2,
      "name" : "TEST_SCHEMA_2",
      "abbreviation" : "TS2",
      "namespace" : "http://test-schema-2-location.org",
      "properties" : [ ],
      "namespaces" : [ ]
    } ]
  }
}

Example Curl Request

$ curl 'http://localhost:8080/schema' -i -X GET \
    -H 'Content-Type: application/json;charset=UTF-8'

Get Schema

A GET request to the /schema/{id} endpoint which will result in the retrieval of the specified schema registered with CAP.

Path Parameters

Table 21. /schema/{id}
Parameter Description

id

The id of the Schema to be retrieved.

Sample Request

GET /schema/5 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: localhost:8080

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 242

{"meta":{"status":"SUCCESS","action":null,"message":"Your request was successful","id":null},"payload":{"Schema":{"id":5,"name":"TEST_SCHEMA","abbreviation":"TS","namespace":"http://test-schema-location.org","properties":[],"namespaces":[]}}}

Example Curl Request

$ curl 'http://localhost:8080/schema/5' -i -X GET \
    -H 'Content-Type: application/json;charset=UTF-8'

Update Schema

A PUT request to the /schema endpoint which will result in the updating of the specified Schema registered with CAP.

Sample Request

PUT /schema HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 168
Host: localhost:8080

{
  "id" : 3,
  "name" : "TEST_SCHEMA_UPDATED",
  "abbreviation" : "TS",
  "namespace" : "http://test-schema-location.org",
  "properties" : [ ],
  "namespaces" : [ ]
}

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 363

{
  "meta" : {
    "status" : "SUCCESS",
    "action" : null,
    "message" : "Your request was successful",
    "id" : null
  },
  "payload" : {
    "Schema" : {
      "id" : 3,
      "name" : "TEST_SCHEMA_UPDATED",
      "abbreviation" : "TS",
      "namespace" : "http://test-schema-location.org",
      "properties" : [ ],
      "namespaces" : [ ]
    }
  }
}

Example Curl Request

$ curl 'http://localhost:8080/schema' -i -X PUT \
    -H 'Content-Type: application/json;charset=UTF-8' \
    -d '{
  "id" : 3,
  "name" : "TEST_SCHEMA_UPDATED",
  "abbreviation" : "TS",
  "namespace" : "http://test-schema-location.org",
  "properties" : [ ],
  "namespaces" : [ ]
}'

Delete Schema

A DELETE request to the /schema endpoint which will result in the retrieval of the specified schema registered with CAP.

Sample Request

DELETE /schema HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 167
Host: localhost:8080

{
  "id" : 4,
  "name" : "TEST_SCHEMA_DELETE",
  "abbreviation" : "TS",
  "namespace" : "http://test-schema-location.org",
  "properties" : [ ],
  "namespaces" : [ ]
}

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 149

{
  "meta" : {
    "status" : "SUCCESS",
    "action" : null,
    "message" : "Your request was successful",
    "id" : null
  },
  "payload" : { }
}

Example Curl Request

$ curl 'http://localhost:8080/schema' -i -X DELETE \
    -H 'Content-Type: application/json;charset=UTF-8' \
    -d '{
  "id" : 4,
  "name" : "TEST_SCHEMA_DELETE",
  "abbreviation" : "TS",
  "namespace" : "http://test-schema-location.org",
  "properties" : [ ],
  "namespaces" : [ ]
}'

Properties By Namespace

A GET request to the /schema/properties endpoint which will result in the retrieval of the specified properties registered with a CAP Schema.

Request Parameters

Parameter Description

namespace

The namespace URI of the desired Property.

Sample Request

GET /schema/properties?namespace=http://test-property-uri.org/ns/property1 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: localhost:8080

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 165

{
  "meta" : {
    "status" : "ERROR",
    "action" : null,
    "message" : "GET http://test-property-uri.org/ns/property1",
    "id" : null
  },
  "payload" : { }
}

Example Curl Request

$ curl 'http://localhost:8080/schema/properties?namespace=http://test-property-uri.org/ns/property1' -i -X GET \
    -H 'Content-Type: application/json;charset=UTF-8'

User API

A Collection of endpoints used for performing User actions.

Credentials

A GET request to the /user/credentials endpoint. This will result in returning the credentials for the current user. Credentials are a specific subset of User data.

All Users

A GET request to the /user/all endpoint. This will result in returning a list of all users in the repository.

Sample Request

GET /user/all HTTP/1.1
Host: localhost:8080

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 554

{
  "meta" : {
    "status" : "SUCCESS",
    "action" : null,
    "message" : "Your request was successful",
    "id" : null
  },
  "payload" : {
    "ArrayList<User>" : [ {
      "id" : 1,
      "username" : "aggiejack@tamu.edu",
      "role" : "ROLE_ADMIN",
      "firstName" : "Jack",
      "lastName" : "Aggie",
      "email" : "aggiejack@tamu.edu"
    }, {
      "id" : 2,
      "username" : "aggiejack@tamu.edu",
      "role" : "ROLE_ADMIN",
      "firstName" : "Jack",
      "lastName" : "Aggie",
      "email" : "aggiejack@tamu.edu"
    } ]
  }
}

Example Curl Request

$ curl 'http://localhost:8080/user/all' -i -X GET

Update

A POST request to the /user/update endpoint. This will result updating the specified user.

Sample Request

Unresolved directive in userAPI.adoc - include::../../../target/generated-snippets/update/http-request.adoc[]

Sample Response

Unresolved directive in userAPI.adoc - include::../../../target/generated-snippets/update/http-response.adoc[]

Example Curl Request

Unresolved directive in userAPI.adoc - include::../../../target/generated-snippets/update/curl-request.adoc[]

Delete

A POST request to the /user/delete endpoint. This will result deleting the specified user.

Sample Request

GET /user/delete HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 158
Host: localhost:8080

{
  "id" : 1,
  "username" : "aggiejack@tamu.edu",
  "role" : "ROLE_ADMIN",
  "firstName" : "Jack",
  "lastName" : "Aggie",
  "email" : "aggiejack@tamu.edu"
}

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 149

{
  "meta" : {
    "status" : "SUCCESS",
    "action" : null,
    "message" : "Your request was successful",
    "id" : null
  },
  "payload" : { }
}

Example Curl Request

$ curl 'http://localhost:8080/user/delete' -i -X GET \
    -H 'Content-Type: application/json;charset=UTF-8' \
    -d '{
  "id" : 1,
  "username" : "aggiejack@tamu.edu",
  "role" : "ROLE_ADMIN",
  "firstName" : "Jack",
  "lastName" : "Aggie",
  "email" : "aggiejack@tamu.edu"
}'

Verify Repository View API

A Collection of CRUD API endpoints used for verifying CAP’s Repository View resource.

Ping Repository View

A POST request to the /repository-view/{type}/ping endpoint. This will result in the asserting the ability to connect to the repository.

Path Parameters

Unresolved directive in verifyRepositoryViewAPI.adoc - include::../../../target/generated-snippets/verify-r-v-ping/path-parameters.adoc[]

Request Fields

Unresolved directive in verifyRepositoryViewAPI.adoc - include::../../../target/generated-snippets/verify-r-v-ping/request-fields.adoc[]

Sample Request

Unresolved directive in verifyRepositoryViewAPI.adoc - include::../../../target/generated-snippets/verify-r-v-ping/http-request.adoc[]

Sample Response

Unresolved directive in verifyRepositoryViewAPI.adoc - include::../../../target/generated-snippets/verify-r-v-ping/http-response.adoc[]

Example Curl Request

Unresolved directive in verifyRepositoryViewAPI.adoc - include::../../../target/generated-snippets/verify-r-v-ping/curl-request.adoc[]

Verify Repository View Authentication

A POST request to the /repository-view/{type}/auth endpoint. This will result in the asserting the ability to access to the repository using the configured credentials.

Path Parameters

Table 22. /repository-view/{type}/verify/auth
Parameter Description

type

The Repository View type name.

Request Fields

Path Type Description

id

Number

Repository View id.

name

String

The name of this Repository View.

rootUri

String

Root URI where to the repository represented by this Repository View.

type

String

The Repository Type of this Repository View.

username

String

Optional username to use when authenticating with the repository represented by this Repository View.

password

String

Optional password to use when authenticating with the repository represented by this Repository View.

schemas

Array

Optional list of Schema to resister with this Repository View.

curators

Array

Optional list of Curators with edit permissions to this Repository View.

metadataPrefixes

Array

Short hand references to the registered schemas.

Sample Request

POST /repository-view/FEDORA/verify/auth HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 229
Host: localhost:8080

{
  "id" : 1,
  "type" : "FEDORA",
  "name" : "TEST_REPOSITORY_VIEW_NAME",
  "rootUri" : "http://test-repository-view.org",
  "username" : "",
  "password" : "",
  "schemas" : [ ],
  "curators" : [ ],
  "metadataPrefixes" : [ ]
}

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 149

{
  "meta" : {
    "status" : "SUCCESS",
    "action" : null,
    "message" : "Your request was successful",
    "id" : null
  },
  "payload" : { }
}

Example Curl Request

$ curl 'http://localhost:8080/repository-view/FEDORA/verify/auth' -i -X POST \
    -H 'Content-Type: application/json;charset=UTF-8' \
    -d '{
  "id" : 1,
  "type" : "FEDORA",
  "name" : "TEST_REPOSITORY_VIEW_NAME",
  "rootUri" : "http://test-repository-view.org",
  "username" : "",
  "password" : "",
  "schemas" : [ ],
  "curators" : [ ],
  "metadataPrefixes" : [ ]
}'

Verify Repository View Content

A POST request to the /repository-view/{type}/content endpoint. This will result in the asserting the validity of the response as a valid repository view data source.

Path Parameters

Table 23. /repository-view/{type}/verify/content
Parameter Description

type

The Repository View type name.

Request Fields

Path Type Description

id

Number

Repository View id.

name

String

The name of this Repository View.

rootUri

String

Root URI where to the repository represented by this Repository View.

type

String

The Repository Type of this Repository View.

username

String

Optional username to use when authenticating with the repository represented by this Repository View.

password

String

Optional password to use when authenticating with the repository represented by this Repository View.

schemas

Array

Optional list of Schema to resister with this Repository View.

curators

Array

Optional list of Curators with edit permissions to this Repository View.

metadataPrefixes

Array

Short hand references to the registered schemas.

Sample Request

POST /repository-view/FEDORA/verify/content HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 229
Host: localhost:8080

{
  "id" : 1,
  "type" : "FEDORA",
  "name" : "TEST_REPOSITORY_VIEW_NAME",
  "rootUri" : "http://test-repository-view.org",
  "username" : "",
  "password" : "",
  "schemas" : [ ],
  "curators" : [ ],
  "metadataPrefixes" : [ ]
}

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 149

{
  "meta" : {
    "status" : "SUCCESS",
    "action" : null,
    "message" : "Your request was successful",
    "id" : null
  },
  "payload" : { }
}

Example Curl Request

$ curl 'http://localhost:8080/repository-view/FEDORA/verify/content' -i -X POST \
    -H 'Content-Type: application/json;charset=UTF-8' \
    -d '{
  "id" : 1,
  "type" : "FEDORA",
  "name" : "TEST_REPOSITORY_VIEW_NAME",
  "rootUri" : "http://test-repository-view.org",
  "username" : "",
  "password" : "",
  "schemas" : [ ],
  "curators" : [ ],
  "metadataPrefixes" : [ ]
}'