Skip to content

Reunião 21 02 2025

cbbathagliniSerpro edited this page Feb 23, 2025 · 3 revisions

🚀 Processo de Criação de Credenciais no CPQD

🔗 1. Acessar o Portal

Acesse o portal pelo seguinte link: 🌍 Portal CPQD Empresas

🔑 2. Obter Wallet e Secret

Navegue até a seção Minha Carteira para obter a Wallet Name e a Secret.

🔐 3. Obter Token de Acesso via Postman

Use o seguinte comando para gerar um token de acesso:

curl --location 'https://staging-id.cpqd.com.br/api/service-authenticator/v1/token' \
--header 'Content-Type: application/json' \
--data '{
    "wallet_name": "{{wallet_name}}",
    "password": "{{secret}}"
}'

🤝 4. Gerar Convite de Conexão

curl --location 'https://staging-id.cpqd.com.br/api/hub-issuer/agent/v2/out-of-band/create-invitation' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{token}}' \
--data '{
    "alias": "issue-credential",
    "metadata": {},
    "handshake_protocols": [
        "https://didcomm.org/connections/1.0"
    ]
}'

🆕 5. Criar Nova Credencial

Acesse Definições de Credencial:

e clique em Nova:

Após a criação, obtenha o Credential Definition.

🎟️ 6. Criar Oferta de Credencial

Usando o cred_def_id obtido no passo anterior, envie a seguinte requisição:

curl --location 'https://staging-id.cpqd.com.br/api/hub-issuer/agent/v2/issue-credential/send-offer' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{token}}' \
--data-raw '{
  "connection_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "cred_def_id": "MoKavRm3zoZBFHMvndmt51:3:CL:5275:default",
  "credential_preview": {
    "attributes": [
      {
        "name": "nome", 
        "value": "Teste"
      },
      {
        "name": "email",
        "value": "[email protected]"
      }
    ],
    "@type": "issue-credential/1.0/credential-preview"
  },
  "auto_issue": true,
  "auto_remove": true,
  "comment": "eu",
  "trace": true
}'

🔍 7. Consultar Status da Oferta

Para verificar o status da oferta de credencial, utilize:

curl --location 'https://staging-id.cpqd.com.br/api/hub-issuer/agent/v2/issue-credential-2.0/records?thread_id=8e4bc84a-07d8-472a-a67f-2c61bc929b48' \
--header 'x-api-key: VYjqmfICaBeVZKZvrUih6mJYqz89XVoz' \
--header 'Authorization: Bearer {{token}}'

📖 Documentação Oficial

Clone this wiki locally