KiCreditRiskManagement en: Difference between revisions

From services.krediidiinfo.ee
Jump to navigation Jump to search
No edit summary
 
(13 intermediate revisions by 4 users not shown)
Line 42: Line 42:
== ''end'' ==
== ''end'' ==


Ending company's credit risk management.
Ending company's credit risk management. The end date of the service is set to the last day of the following month, if the service has been started in the current month, and in the case of a previously started service, the last day of the current month.




Line 54: Line 54:
| regCode
| regCode
| xs:string
| xs:string
| Ettevõtte registrikood.
| Company’s registry code.
|-
|-
| <b>Output parameter:</b>
| <b>Output parameter:</b>
Line 61: Line 61:
| The value is 0, if the request succeeds. If the value is negative, then it is an error code. Possible values of  [http://services.krediidiinfo.ee/wiki/index.php/KiCreditRiskManagement_en#Error_Codes error codes].  
| The value is 0, if the request succeeds. If the value is negative, then it is an error code. Possible values of  [http://services.krediidiinfo.ee/wiki/index.php/KiCreditRiskManagement_en#Error_Codes error codes].  
|}
|}


== ''getCreditRiskData'' ==
== ''getCreditRiskData'' ==
Line 82: Line 81:
| xml
| xml
| xs:string
| xs:string
| Response in XML format. XML layout is located at [http://www.krediidiinfo.ee/schemas/services/KiCreditRiskManagement__getCreditRiskData.xsd http://www.krediidiinfo.ee/schemas/services/KiCreditRiskManagement__getCreditRiskData.xsd]. See an example: [http://www.krediidiinfo.ee/schemas/services/KiCreditRiskManagement__getCreditRiskData.xml KiCreditRiskManagement__getCreditRiskData.xml]. An empty tag '''company''' will be given in XML, if the requested company does not exist in the credit management database   
| Response in XML format. XML schema is located at [http://www.krediidiinfo.ee/schemas/services/KiCreditRiskManagement__getCreditRiskData.xsd http://www.krediidiinfo.ee/schemas/services/KiCreditRiskManagement__getCreditRiskData.xsd]. See an example: [http://www.krediidiinfo.ee/schemas/services/KiCreditRiskManagement__getCreditRiskData.xml KiCreditRiskManagement__getCreditRiskData.xml]. An empty tag ''company'' will be given in XML, if the requested company does not exist in the credit management database   
|}
|}


== ''getEvents'' ==
== ''getEvents'' ==


Etteantud ajavahemikus toimunud sündmuste pärimine.
Requesting events in certain period of time (max 30 days).




{| style="border-style: solid; border-width: 1px;"
{| style="border-style: solid; border-width: 1px;"
!  
!  
! Nimi
! Name
! Tüüp
! Type
! Kirjeldus
! Description
|-
|-
| <b>Sisendparameetrid:</b>  
| <b>Input parameter:</b>  
| begin
| begin
| xs:date
| xs:date
| Alguskuupäev (ka), millest alates toimunud sündmusi soovitakse pärida.
| Start date (incl), from which the events are requested.
|-
|-
|  
|  
| end
| end
| xs:date
| xs:date
| Lõpukuupäev (ka), milleni toimunud sündmusi soovitakse pärida.
| End date (incl), until the events are requested.
|-
|-
| <b>Väljundparameeter:</b>
| <b>Output parameter:</b>
| xml
| xml
| xs:string
| xs:string
| vastus XML formaadis. XML skeem asub aadressil [http://www.krediidiinfo.ee/schemas/services/KiCreditRiskManagement__getEvents.xsd http://www.krediidiinfo.ee/schemas/services/KiCreditRiskManagement__getEvents.xsd]. Vaata näidisfaili: [http://www.krediidiinfo.ee/schemas/services/KiCreditRiskManagement__getEvents.xml KiCreditRiskManagement__getEvents.xml]. Kui päritav ettevõte ei ole krediidiriskide jälgimise all, siis a) kui ettevõte on krediidijärelvalves, siis päringu tulemuseks saadav XML-is on krediidijälvalve sündmused b) kui ettevõte ei ole krediidijärelvalves, siis märgendi ''event'' sisu tühi. 
| Response in XML format. XML schema is located at [http://www.krediidiinfo.ee/schemas/services/KiCreditRiskManagement__getEvents.xsd http://www.krediidiinfo.ee/schemas/services/KiCreditRiskManagement__getEvents.xsd]. See an example: [http://www.krediidiinfo.ee/schemas/services/KiCreditRiskManagement__getEvents.xml KiCreditRiskManagement__getEvents.xml].
|}
|}


= Veakoodid =
= Error codes =


== -20400 UNKNOWN ==
== -20400 UNKNOWN ==


Tundmatu viga
Unknown error


== -20401 INVALID_REGCODE ==
== -20401 INVALID_REGCODE ==


Vigane ettevõtte registrikood
Invalid registry code


== -20402 SERVICE_ALREADY_ACTIVE ==
== -20402 SERVICE_ALREADY_ACTIVE ==


Ettevõte on juba krediidiriskide jälgimise all.
The company is already in credit risk management.


== -20403 SERVICE_INACTIVE ==
== -20403 SERVICE_INACTIVE ==


Ettevõte ei ole krediidiriskide jälgimise all.
The company is not in credit risk management.


== -20404 LONG_PERIOD ==
== -20404 LONG_PERIOD ==


Liiga pikk ajavahemik, milles registreeritud andmeid soovitakse pärida.
Requested period of time is too long.  






= Arendamine =
= Developing =


Liidese integreerimiseks vajaliku arenduse jaoks on tehtud näidiskasutaja:
Sample user is made for integrating the service:


* Autentimise meetod: ''Basic Authentication''
* Method of authentication: ''Basic Authentication''
* Kasutajanimi: ''30546''
* Username: ''30546''
* Parool: ''soapdemo''  
* Password: ''soapdemo''  








= Näide PHP-s =
= Example in PHP =




Line 153: Line 152:
<?php
<?php
/**
/**
  * Example of using Krediidiinfo AS SOAP interface KiCreditRiskManagement.  
  * Example of using Creditinfo Eesti AS SOAP interface KiCreditRiskManagement.  
  *  
  *  
  * In this example the demo username and password is used so there is no need
  * In this example the demo username and password is used so there is no need
  * to contact with Krediidiinfo AS in order to run this program.
  * to contact with Creditinfo Eesti AS in order to run this program.
  *  
  *  
  * @link http://services.krediidiinfo.ee/wiki/index.php/KiCreditRiskManagement
  * @link http://services.krediidiinfo.ee/wiki/index.php/KiCreditRiskManagement
  * @author Julia Parkkonen <julia.parkkonen@krediidiinfo.ee>
  * @author Julia Parkkonen <julia.parkkonen@creditinfo.ee>
  * @created 04.06.2013
  * @created 04.06.2013
  */
  */
Line 173: Line 172:
$resultCode = $client->start($regCode);
$resultCode = $client->start($regCode);
if ($resultCode == 0) {
if ($resultCode == 0) {
     echo "Ettevõte lisatud krediidiriskide jälgimise alla!";
     echo "Company is added into credit risk management!";
}
}


Line 183: Line 182:
$resultCode = $client->end($regCode);
$resultCode = $client->end($regCode);
if ($resultCode == 0) {
if ($resultCode == 0) {
     echo "Ettevõte krediidiriskide jälgimine on lõpetatud!";
     echo "Company's credit risk management is ended!";
}
}



Latest revision as of 08:25, 1 December 2023

Flag of Estonia.svg eesti keeles


Introduction

KiCreditRiskManagement is the name of a Credit Risk Management Web Service based on SOAP protocol. The service - http://www.krediidiinfo.ee/index.php?m=49

WSDL

KiCreditRiskManagement WSDL is located at http://services.krediidiinfo.ee/KiCreditRiskManagement.wsdl.


Methods

start

Adding company into Credit Risk Management.


Name Type Description
Input parameter: regCode xs:string Company’s registry code.
Output parameter: resultCode xs:int The value is 0, if the request succeeds. If the value is negative, then it is an error code. Possible values of error codes.


end

Ending company's credit risk management. The end date of the service is set to the last day of the following month, if the service has been started in the current month, and in the case of a previously started service, the last day of the current month.


Name Type Description
Input parameter: regCode xs:string Company’s registry code.
Output parameter: resultCode xs:int The value is 0, if the request succeeds. If the value is negative, then it is an error code. Possible values of error codes.

getCreditRiskData

Requesting company's basic data and events.


Name Type Description
Input parameter: regCode xs:string Ettevõtte registrikood.
Output parameter: xml xs:string Response in XML format. XML schema is located at http://www.krediidiinfo.ee/schemas/services/KiCreditRiskManagement__getCreditRiskData.xsd. See an example: KiCreditRiskManagement__getCreditRiskData.xml. An empty tag company will be given in XML, if the requested company does not exist in the credit management database

getEvents

Requesting events in certain period of time (max 30 days).


Name Type Description
Input parameter: begin xs:date Start date (incl), from which the events are requested.
end xs:date End date (incl), until the events are requested.
Output parameter: xml xs:string Response in XML format. XML schema is located at http://www.krediidiinfo.ee/schemas/services/KiCreditRiskManagement__getEvents.xsd. See an example: KiCreditRiskManagement__getEvents.xml.

Error codes

-20400 UNKNOWN

Unknown error

-20401 INVALID_REGCODE

Invalid registry code

-20402 SERVICE_ALREADY_ACTIVE

The company is already in credit risk management.

-20403 SERVICE_INACTIVE

The company is not in credit risk management.

-20404 LONG_PERIOD

Requested period of time is too long.


Developing

Sample user is made for integrating the service:

  • Method of authentication: Basic Authentication
  • Username: 30546
  • Password: soapdemo



Example in PHP

<?php
/**
 * Example of using Creditinfo Eesti AS SOAP interface KiCreditRiskManagement. 
 * 
 * In this example the demo username and password is used so there is no need
 * to contact with Creditinfo Eesti AS in order to run this program.
 * 
 * @link http://services.krediidiinfo.ee/wiki/index.php/KiCreditRiskManagement
 * @author Julia Parkkonen <julia.parkkonen@creditinfo.ee>
 * @created 04.06.2013
 */
$wsdl_url = 'http://services.krediidiinfo.ee/KiCreditRiskManagement.wsdl';
$params = array('location'      => 'https://services.krediidiinfo.ee/soap.php?name=KiCreditRiskManagement'
              , 'login'       => '30546' // <-- username. Make sure username is string type (PHP bug?).
              , 'password'    => 'soapdemo'   // <-- password
            );
        
$client = new SoapClient($wsdl_url, $params);

$regCode = '10256137'; 
$resultCode = $client->start($regCode);
if ($resultCode == 0) {
    echo "Company is added into credit risk management!";
}


$xml = $client->getCreditRiskData($regCode);
echo $xml;


$resultCode = $client->end($regCode);
if ($resultCode == 0) {
    echo "Company's credit risk management is ended!";
}


$xml = $client->getEvents('2013-01-01', '2013-01-07');
echo $xml;
?>