diff --git a/README.md b/README.md index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0a1162ebcd6275867ae47d210f326cafe4ed1f45 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,21 @@ +# Documentation for using the ssi service + +These files provide a description of the REST api for interacting with the ssi service, several api’s are available. + +- [Create JWT](./rest-api/create-jwt.md) +- [Credential Issue Request](./rest-api/credential-issue-request.md) +- [Credential Verify Request](./rest-api/credential-verify-request.md) +- [Register Credential Type (Jolocom)](./rest-api/register-credential-type-jolocom.md) +- [Register Organization's Credential Types](./rest-api/register-organizations-credential-types.md) +- [Register Organization](./rest-api/register-organization.md) +- [Registered Credential Type (Jolocom)](./rest-api/registered-credential-type-jolocom.md) +- [Registered Organization's Credential Types](./rest-api/registered-organizations-credential-types.md) +- [Registered Organizations](./rest-api/registered-organizations.md) + +For a description of the content of jwt tokens, refer to + +- [Issue Request](./jwt-descriptions/jwt-credential-issue-request) +- [Issue Response](./jwt-descriptions/jwt-credential-issue-response) +- [Verify Request](./jwt-descriptions/jwt-credential-verify-request) +- [Verify Response](./jwt-descriptions/jwt-credential-verify-request) +- [Create JWT](./jwt-descriptions/response-jwt-create-jwt) \ No newline at end of file diff --git a/jwt-descriptions/jwt-credential-issue-request.md b/jwt-descriptions/jwt-credential-issue-request.md new file mode 100644 index 0000000000000000000000000000000000000000..fedcab7020d4923d5b15f3dedb34ecfa4b5d53e1 --- /dev/null +++ b/jwt-descriptions/jwt-credential-issue-request.md @@ -0,0 +1,37 @@ +# JWT for [Credential Issue Request](../rest-api/credential-issue-request.md) +The JWT should encode a JSON object with the following params. NOTE: The JWT should be created using [our API](../rest-api/create-jwt.md) to automatically include some other required parameters. + +- ## `callbackUrl=[string]` + The REST api of the verifier where to deliver the credential data. + +- ## `aud*=[string]` + *\*Currently added later automatically and hardcoded, but will be required in the future.* + + The intended audience for the jwt (currently hardcoded as `"ssi-service-provider"`). + +- ## `sub=[string]` + The type of jwt, should be `"credential-issue-request"`. + +- ## `jti*=[string]` + *\*Currently added automatically (randomly generated) when [creating a jwt](../rest-api/create-jwt.md), but may be required in the future, possibly with a different name.* + + A unique identifier for the JWT within the context of the issuing party, Used by the issuing party to match a response with the corresponding request. + +- ## `type=[string]` + The type of credential to be issued, as defined in the ssi service. This maps to the specific credential types of the different supported wallets. + +- ## `data=[object]` + Object containing the actual data to be issued. The content of this object should match the schema of the credential type. + +## Example +```json +{ + "callbackUrl": "http://httpbin.org/get?response=", + "aud": "ssi-service-provider", + "sub": "credential-issue-request", + "type": "FirstNameCredential", + "data": { + "firstName": "John" + } +} +``` \ No newline at end of file diff --git a/jwt-descriptions/jwt-credential-issue-response.md b/jwt-descriptions/jwt-credential-issue-response.md new file mode 100644 index 0000000000000000000000000000000000000000..4ff4f1ab67313586249f9cced63fa5aeb8526beb --- /dev/null +++ b/jwt-descriptions/jwt-credential-issue-response.md @@ -0,0 +1,40 @@ +# Credential Verify Response +The JWT returned to the callbackUrl specified in the [request](./jwt-credential-issue-request) encodes a JSON object with the following params. + +- ## `requestId=[string]` + Identifier matching the jti in the verify request. + +- ## `type=[string]` + The type of credential that was issued, as defined in the ssi service. This maps to the specific credential types of the different supported wallets. + +- ## `status=[string]` + The status of the issuing. Can be `success|error|cancelled`. + +- ## `connector=[string]` + The connector that was used to store the issued credentials. + +- ## `iat=[number]` + The "iat" (issued at) claim identifies the time at which the JWT was issued. This claim can be used to determine the age of the JWT. + +- ## `aud*=[string]` + The "aud" (audience) claim identifies the recipients that the JWT is intended for, this should match the identifier of the issuing party (i.e. the party that issued the credentials). + +- ## `iss*=[string]` + The "iss" (issuer) claim identifies the principal that issued the JWT. When receiving a JWT from the ssi service, this should be the `"ssi-service-provider"`. + +- ## `sub=[string]` + The "sub" (subject) of the jwt. Should be `"credential-issue-response"`. + +## Example +```json +{ + "requestId": "Xks8zwLNk0A4", + "type": "FirstNameCredential", + "status": "success", + "connector": "jolocom", + "iat": 1590833726, + "aud": "40d0fbd3-38a3-4a6e-8fe9-cfc56406749d", + "iss": "ssi-service-provider", + "sub": "credential-issue-response" +} +``` \ No newline at end of file diff --git a/jwt-descriptions/jwt-credential-verify-request.md b/jwt-descriptions/jwt-credential-verify-request.md new file mode 100644 index 0000000000000000000000000000000000000000..02526c52588be5188b8176940000c76241922257 --- /dev/null +++ b/jwt-descriptions/jwt-credential-verify-request.md @@ -0,0 +1,31 @@ +# JWT for [Credential Verify Request](../rest-api/credential-verify-request.md) +The JWT should encode a JSON object with the following params. NOTE: The JWT should be created using [our API](../rest-api/create-jwt.md) to automatically include some other required parameters. + +- ## `callbackUrl=[string]` + The REST api of the verifier where to deliver the credential data. + +- ## `aud*=[string]` + *\*Currently added later automatically and hardcoded, but will be required in the future.* + + The "aud" (audience) claim identifies the recipients that the JWT is intended for (currently hardcoded as `"ssi-service-provider"`). + +- ## `sub=[string]` + The "sub" (subject) of the jwt. Should be `"credential-issue-request"`. + +- ## `jti*=[string]` + *\*Currently added automatically (randomly generated) when [creating a jwt](../rest-api/create-jwt.md), but will be required in the future, maybe with a different name.* + + A unique identifier for the JWT within the context of the verifying party. Used by the verifying party to match a response with the corresponding request. + +- ## `type=[string]` + The type of credential that is requested, as defined in the ssi service. This maps to the specific credential types of the different supported wallets. + +## Example +```json +{ + "callbackUrl": "http://httpbin.org/get?response=", + "aud": "ssi-service-provider", + "sub": "credential-verify-request", + "type": "FirstNameCredential" +} +``` \ No newline at end of file diff --git a/jwt-descriptions/jwt-credential-verify-response.md b/jwt-descriptions/jwt-credential-verify-response.md new file mode 100644 index 0000000000000000000000000000000000000000..bb3171547292bb37d81e7c24dc8038fcc975cb67 --- /dev/null +++ b/jwt-descriptions/jwt-credential-verify-response.md @@ -0,0 +1,46 @@ +# Credential Verify Response +The JWT returned to the callbackUrl specified in the [request](./jwt-credential-verify-request) encodes a JSON object with the following params. + +- ## `requestId=[string]` + Identifier matching the jti in the verify request. + +- ## `type=[string]` + The type of credential that was requested, as defined in the ssi service. This maps to the specific credential types of the different supported wallets. + +- ## `status=[string]` + The status of the request. Can be `success|error|cancelled`. + +- ## `connector=[string]` + The connector that was used to provide the requested credentials. + +- ## `data=[object]` + Object containing the actual data that was requested. The content of this object should matches the schema of the credential type. + +- ## `iat=[number]` + The "iat" (issued at) claim identifies the time at which the JWT was issued. This claim can be used to determine the age of the JWT. + +- ## `aud*=[string]` + The "aud" (audience) claim identifies the recipients that the JWT is intended for, this should match the identifier of the verifying party. + +- ## `iss*=[string]` + The "iss" (issuer) claim identifies the principal that issued the JWT. When receiving a JWT from the ssi service, this should be the `"ssi-service-provider"`. + +- ## `sub=[string]` + The "sub" (subject) of the jwt. Should be `"credential-verify-response"`. + +## Example +```json +{ + "requestId": "55IZPT69bbFM", + "type": "FirstNameCredential", + "status": "success", + "connector": "jolocom", + "data": { + "firstName": "John" + }, + "iat": 1590832865, + "aud": "40d0fbd3-38a3-4a6e-8fe9-cfc56406749d", + "iss": "ssi-service-provider", + "sub": "credential-verify-response" +} +``` \ No newline at end of file diff --git a/jwt-descriptions/response-jwt-create-jwt.md b/jwt-descriptions/response-jwt-create-jwt.md new file mode 100644 index 0000000000000000000000000000000000000000..cf5c75302e4dde31e5f943acb7022bf7df82e0c9 --- /dev/null +++ b/jwt-descriptions/response-jwt-create-jwt.md @@ -0,0 +1,34 @@ +# JWT Response to [Create JWT](../rest-api/create-jwt.md) +The JWT response adds the following params. + +- ## `iat=[number]` + The "iat" (issued at) claim identifies the time at which the JWT was issued. This claim can be used to determine the age of the JWT. + +- ## `aud=[string]` + The "aud" (audience) claim identifies the recipients that the JWT is intended for. + +- ## `iss=[string]` + The "iss" (issuer) claim identifies the principal that issued the JWT. + +- ## `jti=[string]` + The "jti" (JWT ID) claim provides a unique identifier for the JWT. + +## Example: +### Submitted + ```json + { + "type": "FirstNameCredential", + "callbackUrl": "https://jwt.io/" + } + ``` +### Decoded response +```json +{ + "type": "FirstNameCredential", + "callbackUrl": "https://jwt.io/", + "iat": 1590824876, + "aud": "ssi-service-provider", + "iss": "40d0fbd3-38a3-4a6e-8fe9-cfc56406749d", + "jti": "DvzGJEoEuhpi" +} +``` \ No newline at end of file diff --git a/rest-api/create-jwt.md b/rest-api/create-jwt.md new file mode 100644 index 0000000000000000000000000000000000000000..ac7d54efe5b0a0f28697a7cb7312477d1fced8a5 --- /dev/null +++ b/rest-api/create-jwt.md @@ -0,0 +1,53 @@ +# Create jwt +API to generate a JSON Web Token (JWT). + +- ## Url + `/api/utils/jwt/:organizationId` + +- ## Method + `POST` + +- ## URL Params + ### Required + `organizationId=[string]` + +- ## Body Params + *JSON object* + + ### Example: + ```json + { + "type": "FirstNameCredential", + "callbackUrl": "https://jwt.io/" + } + ``` + +- ## Success Response + - ### Code + 201 Created + ### Content + ``` + eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoiRmlyc3ROYW1lQ3JlZGVudGlhbCIsImNhbGxiYWNrVXJsIjoiaHR0cHM6Ly9qd3QuaW8vIiwiaWF0IjoxNTkwODI0ODc2LCJhdWQiOiJzc2ktc2VydmljZS1wcm92aWRlciIsImlzcyI6IjQwZDBmYmQzLTM4YTMtNGE2ZS04ZmU5LWNmYzU2NDA2NzQ5ZCIsImp0aSI6IkR2ekdKRW9FdWhwaSJ9.mjCqkRpXzdr4EXpEVSeMxNzSjFbt641qhIOWJ7y2YJ4 + ``` + - ### Decoded JWT + ```json + { + "type": "FirstNameCredential", + "callbackUrl": "https://jwt.io/", + "iat": 1590824876, + "aud": "ssi-service-provider", + "iss": "40d0fbd3-38a3-4a6e-8fe9-cfc56406749d", + "jti": "DvzGJEoEuhpi" + } + ``` + +- ## Error Response + - ### Code + 500 Internal Server Error + ### Content + ```json + { + "statusCode": 500, + "message": "Internal server error" + } + ``` \ No newline at end of file diff --git a/rest-api/credential-issue-request.md b/rest-api/credential-issue-request.md new file mode 100644 index 0000000000000000000000000000000000000000..faaeb9e751eea26000d1413a33e9149adff5e46a --- /dev/null +++ b/rest-api/credential-issue-request.md @@ -0,0 +1,82 @@ +# Credential Issue Request +API to execute a credential issue request (i.e. use the ssi service to offer a credential to a user). + +- ## Url + `/api/issue` + +- ## Method + `GET` + +- ## URL Params + None + +- ## Query Params + ### Required + `token=[string]` + + This should be a jwt, as described [here](../jwt-descriptions/jwt-credential-issue-request.md). + +- ## Body Params + None + +- ## Success Response + - ### Code + 200 OK + ### Content + ```json + { + "issueRequest": { + "hash": "76560bcb4f0ce284fda43721068446098b434061d8267143b6d6f72a2c1a697a", + "jwtId": "I3TBbmXS+m6H", + "requestor": { + "id": 1, + "name": "New org", + "sharedSecret": "76cd77019a62b7c1b0a665bdfec941debbff7c5360f65541016e04db12cbdac8", + "uuid": "40d0fbd3-38a3-4a6e-8fe9-cfc56406749d", + "jolocomWallet": { + "id": 1, + "encryptedSeedHex": "f82494567241333cadb3be24e8735f04fede1293109a2007e18b5381fc83f1733e899107c95c14bf6c7c0257d2a74a457e78d45570a333a9feffad1ba0faceef", + "password": "7c4c3e94eb97fa4fab723bc4c2206704" + } + }, + "type": { + "id": 1, + "type": "FirstNameCredential", + "irmaType": "irma-demo.MijnOverheid.fullName", + "jolocomType": { + "id": 1, + "type": "FirstNameCredential", + "name": "First Name Credential", + "context": [ + { + "lastName": "https://schema.org/givenName" + } + ], + "claimInterface": { + "lastName": "" + } + } + }, + "callbackUrl": "http://httpbin.org/get?response=", + "data": { + "firstName": "" + }, + "id": 2, + "uuid": "c56a4cc0-9e84-469e-8978-48f762f16b24" + }, + "availableConnectors": [ + "jolocom" + ] + } + ``` + +- ## Error Response + - ### Code + 500 Internal Server Error + ### Content + ```json + { + "statusCode": 500, + "message": "Internal server error" + } + ``` \ No newline at end of file diff --git a/rest-api/credential-verify-request.md b/rest-api/credential-verify-request.md new file mode 100644 index 0000000000000000000000000000000000000000..4fb4afadb76f430ea7c5e6989da5a7ee5361d1bd --- /dev/null +++ b/rest-api/credential-verify-request.md @@ -0,0 +1,80 @@ +# Credential Verify Request +API to execute a credential issue request (i.e. use the service to offer a credential to a user). + +- ## Url + `/api/issue` + +- ## Method + `GET` + +- ## URL Params + None + +- ## Query Params + ### Required + - `token=[string]` + + This should be a jwt, as described [here](../jwt-descriptions/jwt-credential-verify-request.md). + +- ## Body Params + None + +- ## Success Response + - ### Code + 200 OK + ### Content + ```json + { + "verifyRequest": { + "id": 5, + "callbackUrl": "http://httpbin.org/get?response=", + "uuid": "28e1fde2-e83e-44cb-9bb1-d17a6643be52", + "jwtId": "fKFqBLnWgo8b", + "hash": "acadcc285cf49b1cbc7585e4dc70f4950f221255ee880a5a9fb6b34f13b91b63", + "type": { + "id": 1, + "type": "FirstNameCredential", + "irmaType": "irma-demo.MijnOverheid.fullName", + "jolocomType": { + "id": 1, + "type": "FirstNameCredential", + "name": "First Name Credential", + "context": [ + { + "lastName": "https://schema.org/givenName" + } + ], + "claimInterface": { + "lastName": "" + } + } + }, + "requestor": { + "id": 1, + "name": "New org", + "sharedSecret": "76cd77019a62b7c1b0a665bdfec941debbff7c5360f65541016e04db12cbdac8", + "uuid": "40d0fbd3-38a3-4a6e-8fe9-cfc56406749d", + "jolocomWallet": { + "id": 1, + "encryptedSeedHex": "f82494567241333cadb3be24e8735f04fede1293109a2007e18b5381fc83f1733e899107c95c14bf6c7c0257d2a74a457e78d45570a333a9feffad1ba0faceef", + "password": "7c4c3e94eb97fa4fab723bc4c2206704" + } + } + }, + "availableConnectors": [ + "jolocom", + "irma" + ] + } + ``` + +- ## Error Response + - ### Code + 500 Internal Server Error + ### Content + ```json + { + "statusCode": 500, + "message": "Internal server error" + } + ``` \ No newline at end of file diff --git a/rest-api/register-credential-type-jolocom.md b/rest-api/register-credential-type-jolocom.md new file mode 100644 index 0000000000000000000000000000000000000000..4fdeabc18e0e9a284c346330c613e28e56796b0a --- /dev/null +++ b/rest-api/register-credential-type-jolocom.md @@ -0,0 +1,75 @@ +# Register Credential Type (Jolocom) +Register a new credential type for issuing and verifying with the Jolocom app. + +- ## Url + `/api/connectors/jolocom` + +- ## Method + `POST` + +- ## URL Params + None + +- ## Body Params + *JSON object with the following params:* + ### Required + `claimInterface=[object]` + + `context=[object]` + + `name=[string]` + + `type=[string]` + + ### Example: + ```json + { + "claimInterface": { + "firstName": "" + }, + "context": [ + { + "firstName": "https://schema.org/givenName" + } + ], + "name": "First Name Credential", + "type": "FirstNameCredential" + } + ``` + +- ## Success Response + - ### Code + 201 Created + ### Content + ```json + { + "type": "FirstNameCredential", + "name": "First Name Credential", + "claimInterface": { + "firstName": "" + }, + "context": [ + { + "firstName": "https://schema.org/givenName" + } + ], + "id": 1 + } + ``` + +- ## Error Response + - ### Code + 400 Bad Request + ### Content + ```json + { + "statusCode": 400, + "message": [ + "type should not be empty", + "type must be a string", + "context must be an array", + "claimInterface must be a non-empty object" + ], + "error": "Bad Request" + } + ``` \ No newline at end of file diff --git a/rest-api/register-oganizations-credential-type copy.md b/rest-api/register-oganizations-credential-type copy.md new file mode 100644 index 0000000000000000000000000000000000000000..d74a34e275ff517164b8b00e15e9171bfdfd39c0 --- /dev/null +++ b/rest-api/register-oganizations-credential-type copy.md @@ -0,0 +1,92 @@ +# Register Organization's Credential Types +Register the mapping of the general credential type to those of different wallets (e.g. Irma and Jolocom) + +- ## Url + `/api/types` + +- ## Method + `POST` + +- ## URL Params + None + +- ## Body Params + *JSON object with the following params:* + ### Required + `organizationId=[number]` + + `type=[string]` + + ### Optional + `irmaType=[string]` + + `jolocomCredentialTypeId=[number]` + + ### Example: + ```json + { + "irmaType": "irma-demo.MijnOverheid.fullName", + "jolocomCredentialTypeId": 1, + "organizationId": 1, + "type": "FirstNameCredential" + } + ``` + +- ## Success Response + - ### Code + 201 Created + ### Content + ```json + { + "type": "FirstNameCredential", + "irmaType": "irma-demo.MijnOverheid.fullName", + "organization": { + "id": 1, + "name": "New org", + "sharedSecret": "76cd77019a62b7c1b0a665bdfec941debbff7c5360f65541016e04db12cbdac8", + "uuid": "40d0fbd3-38a3-4a6e-8fe9-cfc56406749d", + "jolocomWallet": { + "id": 1, + "encryptedSeedHex": "f82494567241333cadb3be24e8735f04fede1293109a2007e18b5381fc83f1733e899107c95c14bf6c7c0257d2a74a457e78d45570a333a9feffad1ba0faceef", + "password": "7c4c3e94eb97fa4fab723bc4c2206704" + } + }, + "jolocomType": { + "id": 1, + "type": "FirstNameCredential", + "name": "First Name Credential", + "context": [ + { + "lastName": "https://schema.org/givenName" + } + ], + "claimInterface": { + "lastName": "" + } + }, + "id": 1 + } + ``` + +- ## Error Response + - ### Code + 400 Bad Request + ### Content + ```json + { + "statusCode": 400, + "message": [ + "jolocomCredentialTypeId must be a number conforming to the specified constraints" + ], + "error": "Bad Request" + } + ``` + - ### Code + 500 Internal Server Error + ### Content + ```json + { + "statusCode": 500, + "message": "Internal server error" + } + ``` \ No newline at end of file diff --git a/rest-api/register-organization.md b/rest-api/register-organization.md new file mode 100644 index 0000000000000000000000000000000000000000..1e8748b94d059a98c0938d6d29e83905d93b5d6c --- /dev/null +++ b/rest-api/register-organization.md @@ -0,0 +1,51 @@ +# Register Organization +Register a new organization that will be able to issue or verify credentials using the ssi service. NOTE: this can take a moment to complete as it also creates, fuels and registers the required Jolocom wallet. + +- ## Url + `/api/organizations/` + +- ## Method + `POST` + +- ## URL Params + None + +- ## Body Params + *JSON object with the following params:* + ### Required + `name=[string]` + + ### Example + ```json + { + "name": "New Org" + } + ``` + +- ## Success Response + - ### Code + 201 Created + ### Content + ```json + { + "name": "New org", + "sharedSecret": "76cd77019a62b7c1b0a665bdfec941debbff7c5360f65541016e04db12cbdac8", + "id": 1, + "uuid": "40d0fbd3-38a3-4a6e-8fe9-cfc56406749d" + } + ``` + +- ## Error Response + - ### Code + 400 Bad Request + ### Content + ```json + { + "statusCode": 400, + "message": [ + "name should not be empty", + "name must be a string" + ], + "error": "Bad Request" + } + ``` \ No newline at end of file diff --git a/rest-api/registered-credential-types-jolocom.md b/rest-api/registered-credential-types-jolocom.md new file mode 100644 index 0000000000000000000000000000000000000000..d14c93e3475bc2679c4b0d9ec7fcb7976f7421f2 --- /dev/null +++ b/rest-api/registered-credential-types-jolocom.md @@ -0,0 +1,42 @@ +# Registered Credential Types (Jolocom) +Retrieve a list with the credential types that are registered for Jolocom. + +- ## Url + `/api/connectors/jolocom` + +- ## Method + `GET` + +- ## URL Params + None + +- ## Body Params + None + +- ## Success Response + - ### Code + 200 OK + ### Content + ```json + [ + { + "id": 1, + "type": "FirstNameCredential", + "name": "First Name Credential", + "context": [ + { + "firstName": "https://schema.org/givenName" + } + ], + "claimInterface": { + "firstName": "" + } + }, + { + ... + } + ] + ``` + +- ## Error Response + \- \ No newline at end of file diff --git a/rest-api/registered-oganizations-credential-types.md b/rest-api/registered-oganizations-credential-types.md new file mode 100644 index 0000000000000000000000000000000000000000..ab685be840d7a45c4cb86b6a0c165c87341684b2 --- /dev/null +++ b/rest-api/registered-oganizations-credential-types.md @@ -0,0 +1,142 @@ +# Registered Organization's Credential Types +Retrieve a list of all credential type mappings (for all organizations). + +- ## Url + `/api/types` + +- ## Method + `GET` + +- ## URL Params + None + +- ## Body Params + None + +- ## Success Response + - ### Code + 200 OK + ### Content + ```json + [ + { + "id": 1, + "type": "LastNameCredential", + "irmaType": null, + "jolocomType": { + "id": 2, + "type": "LastNameCredential", + "name": "Last Name Credential", + "context": [ + { + "lastName": "https://schema.org/givenName" + } + ], + "claimInterface": { + "lastName": "" + } + }, + "organization": { + "id": 1, + "name": "New org", + "sharedSecret": "76cd77019a62b7c1b0a665bdfec941debbff7c5360f65541016e04db12cbdac8", + "uuid": "40d0fbd3-38a3-4a6e-8fe9-cfc56406749d", + "jolocomWallet": { + "id": 1, + "encryptedSeedHex": "f82494567241333cadb3be24e8735f04fede1293109a2007e18b5381fc83f1733e899107c95c14bf6c7c0257d2a74a457e78d45570a333a9feffad1ba0faceef", + "password": "7c4c3e94eb97fa4fab723bc4c2206704" + } + } + }, + { + "id": 2, + "type": "FirstNameCredential", + "irmaType": "irma-demo.MijnOverheid.fullName", + "jolocomType": { + "id": 1, + "type": "FirstNameCredential", + "name": "First Name Credential", + "context": [ + { + "firstName": "https://schema.org/givenName" + } + ], + "claimInterface": { + "firstName": "" + } + }, + "organization": { + "id": 1, + "name": "New org", + "sharedSecret": "76cd77019a62b7c1b0a665bdfec941debbff7c5360f65541016e04db12cbdac8", + "uuid": "40d0fbd3-38a3-4a6e-8fe9-cfc56406749d", + "jolocomWallet": { + "id": 1, + "encryptedSeedHex": "f82494567241333cadb3be24e8735f04fede1293109a2007e18b5381fc83f1733e899107c95c14bf6c7c0257d2a74a457e78d45570a333a9feffad1ba0faceef", + "password": "7c4c3e94eb97fa4fab723bc4c2206704" + } + } + }, + { + "id": 3, + "type": "FirstNameCredential", + "irmaType": "irma-demo.MijnOverheid.fullName", + "jolocomType": { + "id": 1, + "type": "FirstNameCredential", + "name": "First Name Credential", + "context": [ + { + "firstName": "https://schema.org/givenName" + } + ], + "claimInterface": { + "firstName": "" + } + }, + "organization": { + "id": 2, + "name": "My org", + "sharedSecret": "7f4ff0007fc85ae20dafa9bb7f07a141feaf36f9ffdcf96d60dafa5656a7d87a", + "uuid": "cd213adb-95f9-461e-9edf-5b6113748177", + "jolocomWallet": { + "id": 2, + "encryptedSeedHex": "4590fe7181ffa688c3108dfa8152df5f18438fe8c4a07c500c2128d2d7f60c9b70136f531c7c3e43a6a5104b233fed4d6bb9ffaa61cd98b8c063b4987b678e22", + "password": "5a6b80bfa46206a14e64135e8776736f" + } + } + }, + { + "id": 4, + "type": "LastNameCredential", + "irmaType": null, + "jolocomType": { + "id": 2, + "type": "LastNameCredential", + "name": "Last Name Credential", + "context": [ + { + "lastName": "https://schema.org/givenName" + } + ], + "claimInterface": { + "lastName": "" + } + }, + "organization": { + "id": 2, + "name": "My org", + "sharedSecret": "7f4ff0007fc85ae20dafa9bb7f07a141feaf36f9ffdcf96d60dafa5656a7d87a", + "uuid": "cd213adb-95f9-461e-9edf-5b6113748177", + "jolocomWallet": { + "id": 2, + "encryptedSeedHex": "4590fe7181ffa688c3108dfa8152df5f18438fe8c4a07c500c2128d2d7f60c9b70136f531c7c3e43a6a5104b233fed4d6bb9ffaa61cd98b8c063b4987b678e22", + "password": "5a6b80bfa46206a14e64135e8776736f" + } + } + } + ] + ``` + +- ## Error Response + \- \ No newline at end of file diff --git a/rest-api/registered-organizations.md b/rest-api/registered-organizations.md new file mode 100644 index 0000000000000000000000000000000000000000..83f0f04cb1cec91236ede0569cd32a0484baab59 --- /dev/null +++ b/rest-api/registered-organizations.md @@ -0,0 +1,69 @@ +# Registered Organizations +Retrieve a list with all registered organizations. + +- ## Url + `/api/organizations/` + +- ## Method + `GET` + +- ## URL Params + None + +- ## Body Params + None + +- ## Success Response + - ### Code + 201 Created + ### Content + ```json + [ + { + "id": 1, + "name": "New org", + "sharedSecret": "76cd77019a62b7c1b0a665bdfec941debbff7c5360f65541016e04db12cbdac8", + "uuid": "40d0fbd3-38a3-4a6e-8fe9-cfc56406749d", + "jolocomWallet": { + "id": 1, + "encryptedSeedHex": "f82494567241333cadb3be24e8735f04fede1293109a2007e18b5381fc83f1733e899107c95c14bf6c7c0257d2a74a457e78d45570a333a9feffad1ba0faceef", + "password": "7c4c3e94eb97fa4fab723bc4c2206704" + }, + "credentialTypes": [ + { + "id": 1, + "type": "FirstNameCredential", + "irmaType": "irma-demo.MijnOverheid.fullName", + "jolocomType": { + "id": 1, + "type": "FirstNameCredential", + "name": "First Name Credential", + "context": [ + { + "firstName": "https://schema.org/givenName" + } + ], + "claimInterface": { + "firstName": "" + } + } + }, + ] + }, + { + "id": 2, + "name": "My org", + "sharedSecret": "7f4ff0007fc85ae20dafa9bb7f07a141feaf36f9ffdcf96d60dafa5656a7d87a", + "uuid": "cd213adb-95f9-461e-9edf-5b6113748177", + "jolocomWallet": { + "id": 2, + "encryptedSeedHex": "4590fe7181ffa688c3108dfa8152df5f18438fe8c4a07c500c2128d2d7f60c9b70136f531c7c3e43a6a5104b233fed4d6bb9ffaa61cd98b8c063b4987b678e22", + "password": "5a6b80bfa46206a14e64135e8776736f" + }, + "credentialTypes": [] + } + ] + ``` + +- ## Error Response + \- \ No newline at end of file diff --git a/template-jwt-descriptions.md b/template-jwt-descriptions.md new file mode 100644 index 0000000000000000000000000000000000000000..c9d50336bebd480787a46678950e40eb81439afd --- /dev/null +++ b/template-jwt-descriptions.md @@ -0,0 +1,12 @@ +# Title +Description + +- ## `param=[type]` + Identifier matching the jti in the verify request. + +## Example +```json +{ + "param": "value" +} +``` \ No newline at end of file diff --git a/template-rest-api.md b/template-rest-api.md new file mode 100644 index 0000000000000000000000000000000000000000..791b7bdd6fcae735c534d1c3d8d04f5b466541f6 --- /dev/null +++ b/template-rest-api.md @@ -0,0 +1,53 @@ +# Title +Description + +- ## Url + `url/:param` + +- ## Method + `GET|POST|DELETE|PUT` + +- ## URL Params + ### Required + `param=[type]` + ### Optional + `param=[type]` + +- ## Query Params + ### Required + `queryparam=[type]` + ### Optional + `queryparam=[type]` + +- ## Body Params + JSON object with the following params + ### Required + `bodyparam=[type]` + ### Optional + `bodyparam=[type]` + ### Example + ```json + { + "bodyparam": "value" + } + ``` + +- ## Success Response + - ### Code + ... + ### Content + ```json + { + ... + } + ``` + +- ## Error Response + - ### Code + ... + ### Content + ```json + { + ... + } + ``` \ No newline at end of file