0xPolygonID/issuer-node

Issuer node Core API (`localhost:3001`) and UI API (`localhost:3002`) have different api endpoints

Closed this issue · 6 comments

Creating a credential with Core API gives this error

{
  "message": "invalid did format"
}

Also the endpoints are very different. It seems like the UI's API server is more stable and actively developed than the Core API server. Which API server is recommended to be used for Production environment?

For our use case, we just need the API and not the UI component.

Issuer node Core API (localhost:3001) and UI API (localhost:3002) have different api endpoints
Right, we need to adapt the UI API for the UI needs that’s why some api calls such as the create credential may be slightly different.
As the response message says the problem may be in the path parameter, it should be sent the issuer did there. Curl example 👇
curl --location 'localhost:3001/v1/did:polygonid:polygon:mumbai:2qPrfvMjSQPRqZBRwt6FAMm4YgAzqA7YYAto3zbsT2/claims'
--header 'Authorization: Basic dXNlci1pc3N1ZXI6cGFzc3dvcmQtaXNzdWVy'
--header 'Content-Type: application/json'
--data '{
"credentialSchema":"https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json/KYCAgeCredential-v3.json",
"type": "KYCAgeCredential",
"credentialSubject": {
"id": "did:polygonid:polygon:mumbai:2qMZrfBsXuGFTwSqkqYki78zF3pe1vtXoqH4yRLsfs",
"birthday": 19960424,
"documentType": 2
},
"expiration": 1903357766
}'

Got it. Now I tried using API server UI and got this

Screenshot 2023-07-20 at 3 03 33 PM

Also how we can specify the proof type while requesting a claim from core API?
These are the provided schemas for request body for both

// UI API (localhost:3002)
{
    credentialSchema*: string
    type*: string
    credentialSubject*: {
    }
    expiration: date-time
    signatureProof: boolean
    mtProof: boolean
}
// Issuer node Core API (localhost:3001) 
{
    credentialSchema*: string
    type*: string
    credentialSubject*: {
    }
    expiration: integer
    version: integer
    revNonce: integer
    subjectPosition: string
    merklizedRootPosition: string
}

Hi @raghav-goyal-coindcx, In core-api the type of test is not specified in the request as you point out, by default it is created with both, i.e. sig once we create the credential and mtp once we publish the on chain status. In case of having the notification service up, a push notification will arrive to update the credential with the mtp type, in case of not having the notification service up, we will have to scan the QR again to be able to update the credential and obtain the new type.

Can you provide more details about the notification service?

the notification service allows the user to receive a push notification in his polygon ID app when the issuer issues a credential, so there is no need to scan the QR, just accept the push notification and the credential is added to his wallet.
This notification system is a separate program that is automatically launched when we run make run-ui-arm or make run-ui-arm.
In case you want to launch the notification system without the UI, you can start it directly using the docker-compose

That's great!
Thanks a lot. Closing this issue.