register-credential-type-jolocom.md 1.35 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 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"
    }
    ```