Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

Collection Open Keys - Data Sharing

 

 

POST Token

To start a journey, it is necessary to generate a token in which client_id and client_secret must be indicated , according to the model below.

 

Token generation URL

https://onboard.smartkeys.engdev.fsapps.io/api/portal/onboard/v1/token

 

cURL for Token generation

curl --location 'https://onboard.smartkeys.engdev.fsapps.io/api/portal/onboard/v1/token' \
--header 'Content-Type: application/json' \
--data '{   
    "client_id":"e1987ec5-2567-4048-ace9-6e6d7b9f77fc",
    "client_secret": "bb4c8136-874a-42ce-bbdc-ac422f5f5b71"
}'

 

Response:

{
    "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJJUV96OEhCYTFqdlZPMGVVcDl6aW5ldmJVaG9uSlI2cEJsOHBoQnVsSXAwIn0.eyJleHAiOjE2ODA2MjE3OTIsImlhdCI6MTY4MDYxODE5MiwianRpIjoiNmMyMjAyMjUtOTJlZS00YTFkLWE3MGUtMWFjZGZmNDE3OGI4IiwiaXNzIjoiaHR0cHM6Ly9rZXljbG9hay5mdWxsLWRldi5maW5hbnN5c3RlY2guY29tLmJyL2F1dGgvcmVhbG1zL3NtYXJ0LWtleXMiLCJhdWQiOiJhY2NvdW50Iiwic3ViIjoiOTEzYTBmZjYtNjE4Yy00NDM3LWE0ZWUtMmU0ZmQyYzVmMDU4IiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiZTE5ODdlYzUtMjU2Ny00MDQ4LWFjZTktNmU2ZDdiOWY3N2ZjIiwiYWNyIjoiMSIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJvZmZsaW5lX2FjY2VzcyIsImRlZmF1bHQtcm9sZXMtc21hcnQta2V5cyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsiZTE5ODdlYzUtMjU2Ny00MDQ4LWFjZTktNmU2ZDdiOWY3N2ZjIjp7InJvbGVzIjpbInVtYV9wcm90ZWN0aW9uIl19LCJhY2NvdW50Ijp7InJvbGVzIjpbIm1hbmFnZS1hY2NvdW50IiwibWFuYWdlLWFjY291bnQtbGlua3MiLCJ2aWV3LXByb2ZpbGUiXX19LCJzY29wZSI6ImVtYWlsIHByb2ZpbGUiLCJjbGllbnRJZCI6ImUxOTg3ZWM1LTI1NjctNDA0OC1hY2U5LTZlNmQ3YjlmNzdmYyIsImNsaWVudEhvc3QiOiIxMC4yNDAuMC4xMCIsImVtYWlsX3ZlcmlmaWVkIjpmYWxzZSwicHJlZmVycmVkX3VzZXJuYW1lIjoic2VydmljZS1hY2NvdW50LWUxOTg3ZWM1LTI1NjctNDA0OC1hY2U5LTZlNmQ3YjlmNzdmYyIsImNsaWVudEFkZHJlc3MiOiIxMC4yNDAuMC4xMCJ9.fRaM_i2uIohrN8WcOmlD4M3bJf4lu8zEtKKNv3dW9xiP2QmvDTCX3LIgcwakMFTahjZdIJFK95ioaEPvQpLK38QXAKJPMfzEjar39ruUNth4pqiE8iPBGTV4lNSIMArMI-pgBOpJCr2lLDfKnjvrkIqf1rrnCGdZc8UhpxkJtbtFBVDlvQBnFp-N_KiKyYIIvUvEqzHxetag9W715b9DqoDynHp_Pf7kkk1g5P4U7cQjKlKAYNoIlNiJuhrqnaFQjE-E3iltf_PDzSxQRFvavI4dJYX8dofzNLKDgmXLJ6iqfh9g7G-ny383JJp1ObKy-N876DPzimWrtdX4FAgBpA",
    "expires_in": 3600,
    "refresh_expires_in": 0,
    "token_type": "Bearer",
    "not-before-policy": 0,
    "scope": "email profile"
}

 

 

POST Data Reception

With the generated token, it is necessary to pass it in the authorization of the call /consents , to obtain the user's consent and information, according to the model below.

 

https://api-smartkeys.celcoin.dev.fsapps.io/api/smart-keys/data-reception/v1/consents

 

curl --location 'https://api-smartkeys.engdev.fsapps.io/api/smart-keys/data-reception/v1/consents' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkI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yIsImNsaWVudEFkZHJlc3MiOiIxMC4yNDAuMC4xMCJ9.fRaM_i2uIohrN8WcOmlD4M3bJf4lu8zEtKKNv3dW9xiP2QmvDTCX3LIgcwakMFTahjZdIJFK95ioaEPvQpLK38QXAKJPMfzEjar39ruUNth4pqiE8iPBGTV4lNSIMArMI-pgBOpJCr2lLDfKnjvrkIqf1rrnCGdZc8UhpxkJtbtFBVDlvQBnFp-N_KiKyYIIvUvEqzHxetag9W715b9DqoDynHp_Pf7kkk1g5P4U7cQjKlKAYNoIlNiJuhrqnaFQjE-E3iltf_PDzSxQRFvavI4dJYX8dofzNLKDgmXLJ6iqfh9g7G-ny383JJp1ObKy-N876DPzimWrtdX4FAgBpA' \
--header 'Content-Type: application/json' \
--data '{
  "data": {
    "loggedUser": {
      "document": {
        "identification": "02981994166",
        "rel": "CPF"
      }
    },
    "permissions": [
            "ACCOUNTS_READ",
						"ACCOUNTS_OVERDRAFT_LIMITS_READ",
						"ACCOUNTS_BALANCES_READ",
						"ACCOUNTS_TRANSACTIONS_READ",
						"CREDIT_CARDS_ACCOUNTS_BILLS_READ",
						"CREDIT_CARDS_ACCOUNTS_BILLS_TRANSACTIONS_READ",
						"CREDIT_CARDS_ACCOUNTS_LIMITS_READ",
						"CREDIT_CARDS_ACCOUNTS_READ",
						"CREDIT_CARDS_ACCOUNTS_TRANSACTIONS_READ",
						"CUSTOMERS_PERSONAL_ADITTIONALINFO_READ",
						"CUSTOMERS_PERSONAL_IDENTIFICATIONS_READ",
						"LOANS_READ",
						"LOANS_WARRANTIES_READ",
						"LOANS_SCHEDULED_INSTALMENTS_READ",
						"LOANS_PAYMENTS_READ",
						"FINANCINGS_READ",
						"FINANCINGS_WARRANTIES_READ",
						"FINANCINGS_SCHEDULED_INSTALMENTS_READ",
						"FINANCINGS_PAYMENTS_READ",
						"UNARRANGED_ACCOUNTS_OVERDRAFT_READ",
						"UNARRANGED_ACCOUNTS_OVERDRAFT_WARRANTIES_READ",
						"UNARRANGED_ACCOUNTS_OVERDRAFT_SCHEDULED_INSTALMENTS_READ",
						"UNARRANGED_ACCOUNTS_OVERDRAFT_PAYMENTS_READ",
						"INVOICE_FINANCINGS_READ",
						"INVOICE_FINANCINGS_WARRANTIES_READ",
						"INVOICE_FINANCINGS_SCHEDULED_INSTALMENTS_READ",
						"INVOICE_FINANCINGS_PAYMENTS_READ",
						"RESOURCES_READ"
    ],
    "expirationDateTime": "2023-12-31T00:00:00Z"
  },
  "brandId": "95dd24d2-902e-49e1-ad0d-e02d938447ba",
  "redirectUri": "https://smart-keys.finansystech.com.br:8080/callback"
}'

 

Response:

{
    "authorizationUrl": "https://openfinance.dev.fbank.opb.obm.engdev.fsapps.io/orgs/finansystech/auth?client_id=xcFd-8KjONJT2FCEHCnTK&scope=openid%20consent%3Aurn%3Afinansystech-dev%3A173d2e64-b51c-40f3-89f6-a04b429bbd33%20accounts%20credit-cards-accounts%20customers%20loans%20financings%20unarranged-accounts-overdraft%20invoice-financings%20resources&response_type=code%20id_token&redirect_uri=https%3A%2F%2Fsmartkeys-ui.engdev.fsapps.io%2Fcallback&request_uri=urn%3Aietf%3Aparams%3Aoauth%3Arequest_uri%3AJtyZkiseLta9akkCRRpCT"
}

 

 

GET Authorization URL - Journey Demo simulation

After the user's definitions regarding the data they want to share and the sharing period, we must obtain the redirection URL for the login at the transmitter, where the interaction_id for the login is obtained, according to the model below.

 

https://openfinance.dev.fbank.opb.obm.engdev.fsapps.io/orgs/finansystech/auth?client_id=xcFd-8KjONJT2FCEHCnTK&https://openfinance.dev.fbank.opb.obm.engdev.fsapps.io/orgs/finansystech/auth?client_id=https://onboard.smartkeys.engdev.fsapps.io/api/portal/onboard/v1/reception

 

curl --location 'https://openfinance.dev.fbank.opb.obm.engdev.fsapps.io/orgs/finansystech/auth?client_id=xcFd-8KjONJT2FCEHCnTK&scope=openid%20consent%3Aurn%3Afinansystech-dev%3Ae119d330-4e42-4f9b-ae25-8fabb53de785%20accounts%20credit-cards-accounts%20customers%20loans%20financings%20unarranged-accounts-overdraft%20invoice-financings%20resources&response_type=code%20id_token&redirect_uri=https%3A%2F%2Fsmartkeys-ui.engdev.fsapps.io%2Fcallback&request_uri=urn%3Aietf%3Aparams%3Aoauth%3Arequest_uri%3AkdDMUphtJfrVHFm4nC-5H'

 

Through the scenario experienced by the user, in the Transmitter environment, you will come across the Response models listed below.

 

Response

{
    "url": "https://smartkeys-ui.engdev.fsapps.io/callback?ticket=eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICIwMTQ4ZjkxZS01NjA1LTRlYzktYWY3My0wM2UzOGNiNmIwNGUifQ.eyJleHAiOjE2ODA2MjU0MjUsIm5iZiI6MCwiaWF0IjoxNjgwNjIxODI1LCJwZXJtaXNzaW9ucyI6W3sicnNpZCI6IjNlN2Q4NTMxLWQ4MjMtNDg1Ny04NjZiLTZmMTg2OTMyNWY4NiJ9XSwianRpIjoiZjQzYTgzZWYtMGE0MC00ZTgyLThiOWMtZjhiZGFiNjM2ZWZiLTE2ODA2MjE4NTAwODMiLCJhdWQiOiJodHRwczovL2tleWNsb2FrLmZ1bGwtZGV2LmZpbmFuc3lzdGVjaC5jb20uYnIvYXV0aC9yZWFsbXMvc21hcnQta2V5cyIsInN1YiI6ImM4OTJkYjViLTUyMDktNDBhOS1iNGQwLTdjMmM4MzViYWM0OCIsImF6cCI6ImNlbGNvaW4ifQ.nhW9PVOlHE2sgzy4iU2MeqOi_QDAjI0rAf2isytNmXw&state=lPOOqD1D-Fjndvnt63moETZVIiTqpFRf4EVOFtATXuE"
}

 

Response to error scenario

 

>>>>> insert the Json for the error scenario<<<<<<

 

ATTENTION: after receiving a return of a token inside the “ticket” tag, you must insert it in the next resource call to obtain the consented return data from the user, according to the model below.

 

 

 

GET Resources

curl --location --request GET 'https://api-smartkeys.celcoin.dev.fsapps.io/api/smart-keys/data-consumer/v1/consume?link=%2Fopen-banking%2Fresources%2Fv1%2Fresources' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICIwMTQ4ZjkxZS01NjA1LTRlYzktYWY3My0wM2UzOGNiNmIwNGUifQ.eyJleHAiOjE2ODA2MjU0MjUsIm5iZiI6MCwiaWF0IjoxNjgwNjIxODI1LCJwZXJtaXNzaW9ucyI6W3sicnNpZCI6IjEwMmJiMDk5LWQ3NmEtNDVjNS04ZmM3LTBjNzI2MzZiN2NlZSJ9XSwianRpIjoiZjNlYTI3YmQtNWMwMC00YWNjLWE2NTMtOGRmNzg0YWZiYWU5LTE2ODA2MjM1MjI1NjciLCJhdWQiOiJodHRwczovL2tleWNsb2FrLmZ1bGwtZGV2LmZpbmFuc3lzdGVjaC5jb20uYnIvYXV0aC9yZWFsbXMvc21hcnQta2V5cyIsInN1YiI6ImM4OTJkYjViLTUyMDktNDBhOS1iNGQwLTdjMmM4MzViYWM0OCIsImF6cCI6ImNlbGNvaW4ifQ.38r_D1AG_yx_0gFPBsXPZrQ0aLWP8HR0eLE-yVXmIP4&state=TwL_t-GGukgNSUMeBhMj06GAOYMXLehIfILkKgkf9HI' \
--header 'Content-Type: application/json' \
--data '{}'

 

ATTENTION: it is necessary to pass the token received inside the ticket of the previous /callback call, in the authorization of the /resources call to obtain the user's consented return data, according to the model below.

 

 

After this step, just call the API on the aggregator

 

  • No labels