Store Object
Encrypt and store any object represented as a Protocol Buffer
Description
Used to encrypt and store objects in the object store. See Encrypted Object Store for additional information.
Objects must be passed as a JSON representation of a Google Protocol Buffer message. The message will be parsed, then stored.
info
See API Key and Permissioning Others sections for more detail on which keys are used for encryption.
Usage
URL: https://{host}/api/v1/eos
Method: POST
Headers:
- Local
- Test/Production
info
Supply one x-uuid
header when running locally.
Key | Value |
---|---|
Content-Type | multipart/form-data |
x-uuid | <Provenance Member UUID> |
info
Supply one apikey
header when running in test or production environments..
Key | Value |
---|---|
Content-Type | multipart/form-data |
apikey | <API Key> |
Request Body:
{
"objectStoreAddress": "",
"permissions": {
"audiences": [],
"permissionDart": true,
"permissionPortfolioManager": true,
},
"message": {}
"type": ""
}
Field | Description | Data Type |
---|---|---|
objectStoreAddress | The URL to the encrypted object store to run against | String |
permissions | Object containing PermissionInfo (See Permissioning Others) | JSON |
message | The asset that is stored against the EOS. This can be any JSON formatted Google Protocol Buffer that matches the type provided in this request | JSON |
type | The fully qualified type url matching the Protocol Buffer provided as JSON in the message | String |
Response Status Codes:
Code | Meaning |
---|---|
200 | File accepted and stored |
400 | Illegal arguments |
500 | Server error |
Response Body:
{
"hash": "string",
"uri": "string",
"bucket": "string",
"name": "string"
}
Field | Description | Data Type |
---|---|---|
hash | The returned hash of the saved object in EOS | String |
uri | The location of the saved object | String |
bucket | The volume path of the saved data | String |
name | The name of the saved data | String |
Example
Sample Request
The following example stores a LoanState
object, representing the current state of an outstanding loan.
curl --location --request POST 'localhost:8080/p8e-cee-api/external/api/v1/eos' \
--header 'x-uuid: deadbeef-face-479b-860c-facefaceface' \
--header 'Content-Type: application/json' \
--data-raw '{
"objectStoreAddress": "grpc://localhost:5001",
"permissions": {
"permissionDart": true,
"permissionPortfolioManager": true
},
"message": {
"id": {
"value": "65baf01d-ee8b-4ad2-b646-cffe26640df3"
},
"effectiveTime": "2022-05-22T00:00:00.000Z",
"servicerName": "Servicer One",
"totalUnpaidPrinBal": {
"amount": 250000.00,
"currency": "USD"
},
"accruedInterest": {
"amount": 50.00,
"currency": "USD"
},
"dailyIntAmount": {
"amount": 5.00,
"currency": "USD"
},
"loanStatus": {
"status": "IN REPAY",
"effectiveTime": "2022-05-22T00:00:00.000Z"
}
},
"type": "tech.figure.servicing.v1beta1.LoanStateOuterClass$LoanState"
}'
Sample Response
{
"hash": "o0iERVQp7v7WdSkq8dlREr+yP8kEuAHvBMmprazYr0k=",
"uri": "object://localhost:8080/o0iERVQp7v7WdSkq8dlREr+yP8kEuAHvBMmprazYr0k=",
"bucket": "/mnt/data",
"name": "NOT_STORAGE_BACKED"
}