DEVELOPER GUIDE
How to integrate Link
Basic WhiteLabel
4 min
1\ generate a link url the basic whitelabel is the easiest way to use klavi services when you lack technical development resources you just need to contact the business personnel( crie\@klavi ai mailto\ crie\@klavi ai ) to request a pre generated url from klavi for you you can integrate this url into your service and directly send it to your users the generated url is similar to this https //conecte sandbox klavi ai/data/v1/basic links/yourappid https //conecte sandbox klavi ai/data/v1/basic links/yourappid if you were a klavi customer before 22/11/2024, you may be able to use the links according to the old nomenclature, then, it should be similar to this https //open sandbox klavi ai/data/v1/basic links/yourappid https //open sandbox klavi ai/data/v1/basic links/yourappid supported path parameters according to your business needs, if you want to lock end users or prevent users from entering cpf again, you can add personal tax id to the above url, similar to this https //conecte sandbox klavi ai/data/v1/basic links/yourappid?personal tax id=76109277673 https //conecte sandbox klavi ai/data/v1/basic links/yourappid?personal tax id=76109277673 if you were a klavi customer before 22/11/2024, you may be able to use the links according to the old nomenclature, then, it should be similar to this https //open sandbox klavi ai/data/v1/basic links/yourappid?personal tax id=76109277673 https //open sandbox klavi ai/data/v1/basic links/yourappid?personal tax id=76109277673 as mentioned above, the path parameter supports the following parameters parameter name type description personal tax id string the cpf of the end user, for personal accounts only business tax id string the cnpj of the company, for business accounts only email string end user's email, compliance needs phone string end user's phone, compliance needs institution code string pre set parameters, the purpose is to avoid users choosing specific institutions redirect url string the url for redirection upon successful link initialization it's value must be processed in encodeuricomponent() function as below, for example “%3a” replaces “ ” “%2f” replaces “/” “%3f” replaces “?” “%3d” replaces “=” products callback url string report products callback url, for open finance only it's value must be processed in encodeuricomponent() function as below, for example “%3a” replaces “ ” “%2f” replaces “/” “%3f” replaces “?” “%3d” replaces “=” external info string used for partners to transmit information, which will be carried in reports sent to partners it's value must be processed in encodeuricomponent() function as below, for example “%3a” replaces “ ” “%2f” replaces “/” “%3f” replaces “?” “%3d” replaces “=” connection key string connection key, the connectionkey has been sent to the partner in the report, for open data update case only app link string after the organization authorization is completed, it will jump to the url address of app link the url carries the parameter key, which is the value of app redirect url key , and value is the url address to be redirect app redirect url key string need to be used together with app link to identify the url parameter key that the app needs to redirect perhaps you have noticed that the above parameters similar to the create a link docid\ mz5jywmwvljrezzqpd30s api parameters except for changing from a camelcase to snake case that's right, it's like this because these parameters are in the body of the api when create a link docid\ mz5jywmwvljrezzqpd30s , so camelcase is used however, if you want to use path parameters to pass, it's best to use a snake case another very important point 1 redirect url to being a url, if you want to use this parameters, remember to encode them console log(`?x=${encodeuricomponent('https //mydomain com?uuid=22222')}`); output \> "?x=https%3a%2f%2fmydomain com%3fuuid%3d22222" 2 products callback url and external info is object type in create a link docid\ mz5jywmwvljrezzqpd30s api, if you want to use these parameters, remember to stringify and encode them external info=encodeuricomponent(json stringify({ 'uuid' 'xxx 122 333 111','customization' {'institutions' \[ '001', '033' ],'landingtitle' 'welcome!','landingsubtitle' 'welcome!'}})) there is an exception, the object with key customization can be used by partners to customize some content of whitelabel for specific customized content, please contact the operations personnel( crie\@klavi ai mailto\ crie\@klavi ai ) 2\ fetch product data you can use web or webview to open the link url, make subsequent selection of institutions, redirect to that institution for authentication, and return to the final result web page klavi backend will send you the results through event webhook(even if it is a failed state), after the status change to authorised , you can send the specific report generation request you want based on the end user type(personal or business, their endpoints are different) command curl location 'https //api sandbox klavi ai/data/personal/institution data' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ header 'authorization bearer jhbgcioijfuzi1niis qtyjayoc1hn2zhmwfjzgrjzjkilcj0 nltqpazheq4p2xfd' \\ \ data '{"taxid" "string","institutionid" "string","linkid" "string","consentid" "array","products" "array","productscallbackurl" "object"}' expected response { "requestid" "1325412e e566 4f4e ac5b 2f4471586b89", "message" "ok" } after you submit a request to generate specific or all report(the report you want to purchase has already been limited by klavi backend), klavi randomly starts retrieving data from the institution and processing it to generate the corresponding report, which will be sent to you through the report webhook klavi also supports not having to actively call this endpoint after you move to production, klavi can proactively send all the reports to your webhook, or send them to klavi's storage space you can download them at any time through the klavi console