Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
kb:api_cer_list [2024/11/20 09:41] – created ognjen.bogicevickb:api_cer_list [2024/11/20 13:36] (current) ognjen.bogicevic
Line 1: Line 1:
-====== Generisanje tokena ======+====== Kursna lista Narodne banke Srbije ======
  
-Generisanje sesijskog tokena koristi se pri pozivu metoda za prikaz ili izmenu podataka u sistemu. API zahtev dostupan je u SOAP i REST formatima podatakaZa oba formata istu su nazivi i tipovi atributa samo je drugačija struktura podataka XML ili JSON.+Ovaj API omogućava dohvat dnevne kursne liste koju objavljuje Narodna banka Srbije.\\ 
 +Podaci uključuju važeće devizne kurseve za različite valute prema dinaru (RSD).\\ 
 +Sve opisane status kodove možete pronaći na [[:kb:web_api:http_codes|HTTP status kodovi]].
  
 ===== Zahtev ===== ===== Zahtev =====
Line 8: Line 10:
  
 <code> <code>
-POST https://ws.melany.rs/api/rest/auth+GET https://ws.melany.rs/api/rest/cer/nbs
  
 </code> </code>
  
-=== SOAP Endpoint === +==== URL ulazni parametri ====
- +
-<code> +
-POST https://ws.melany.rs/api/soap/auth +
- +
-</code> +
- +
-==== Ulazni parametri ====+
  
 ^Naziv^Tip^Obavezno^Opis^Revizija| ^Naziv^Tip^Obavezno^Opis^Revizija|
-|username|String|Obavezno polje|Korisničko ime koje se koristi za autentifikaciju.|24-11-13| +|code|String|Obavezno polje|Šifra valute.|24-11-13| 
-|password|String|Obavezno polje|Korisnička lozinka dodeljena korisniku prilikom otvaranja naloga.|24-11-13| +|rate|String|Obavezno polje|Tip kursa: ratebuy, rateavg, ratesell|24-11-13| 
-|duration|Integer|Nije obavezno polje|Trajanje autentifikacijskog tokena se izražava minutama. Ako nije specificirano ili je vrednost postavljena na 0, podrazumevano vreme trajanja tokena je 24 časa.|24-11-13| +|startdate|String|Obavezno polje|Početni datum za pretragu formatu YYYY-MM-DD.|24-11-13| 
-|company|Integer|Obavezno polje|Identifikator kompanije ili entiteta koji zahteva autentifikaciju.|24-11-13|+|typeid|String|Obavezno polje|Identifikator tipa kursa (npr. srednji kurs, prodajni kurs itd.).|24-11-13|
  
 ===== Rezultat ===== ===== Rezultat =====
  
 ^Naziv^Tip^Opis| ^Naziv^Tip^Opis|
-|code|String|Niz karaktera, određenog roka trajanja, koji jedinstveno identifikuju korisnika i sesiju kojoj radi.| +|rate|number|Kurs za valutu izražen dinarima (RSD).| 
-|expires|Date|Datum i vreme istak tokena prema postavljenom parametru "duration".|+|expires|string($date)|Datum od kada kurs stupa na snagu (YYYY-MM-DD).| 
 +|expires|string($date)|Datum do kada kurs važ(YYYY-MM-DD).|
  
 ===== Primeri ===== ===== Primeri =====
Line 38: Line 34:
 <code> <code>
  
-curl -X 'POST' \ +curl -X 'GET' \ 
-  'https://ws.melany.rs/api/rest/auth' \+  'https://ws.melany.rs/api/rest/cer/nbs?code=36&rate=rateavg&startdate=2022-03-10&typeid=1' \
   -H 'accept: application/json' \   -H 'accept: application/json' \
-  -H 'Content-Typeapplication/json'+  -H 'AuthorizationBearer eyJjdHkiOiJKV1QiLCJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00ifQ.yzD3amqkvVah8VVW31nnUgINEpZv7tmhC6DdiiXqctSek3deJ1gLbZO21lO3tgLpBd174yrH0pDN-NoNfIuaksXWRrGo8g-uN7_52Z9N_9ke72M5ddP8ociyH2Tlb8Wb57ebLq9vTT2rlwBElDYUev_ivWfOgtEk3RGvy0GwV_juVjmfykq9ypKGYykGWMCXRlyxpKrtOYYhrz5U5-EO0i-sspV8YL0HHvmd20-jPI9kC9vNFhXTbYWzF5hBjkl3OA1fOv9V53UmZijjwGIAYBNL4ygXsGDTBGreVdlRH9jKlDk4nDVpJhfJvigVERKCoQAI9Gq3ZX8UAAGjBWdWiw.vnA_Irhw-_9NHwkk.4TyH0Gj5cmqUNLZCDs_j06clJ9knHLmUxFV6Y3yqwixieacJU4llv7qsI4d10s06iEFj_laeLSpM_Q3bHHgLGmvjA-OOaJLJlL3u7eiE8Z5y0s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VSIUPh_m89H1MW3zmiCWnFk0O5cpB-_MYtkqgoLBbKTOqGcv8T5mzaxLDEJWVGsSLhx6jJJaRugD99oTs13yA0q5toVM36Fv16g8N1bW3QBUEtwIEGN_-bpxoZBOpqfoiCRekucpw1PSK97.yJ24cpDTiF6sMbgXuYY2xA'
-  -d '{ +
-  "username": "melany", +
-  "password": "password", +
-  "duration": 0, +
-  "company": 10 +
-}'+
  
 </code> </code>
Line 54: Line 44:
  
 <code> <code>
-{ +[ 
-  "code": "eyJjdHkiOiJKV1QiLCJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00ifQ.gI21vCXCCrQms35AWsEj_C5xYDhn_23Sdmbd-J1mx4tQkAqAsLG2JgwQSKaMHcNfHA0pKSFJ5q_9uf-zhRRX0KzCvo6-ZLrqpb6UccIRSGIrCXtFUtRKGPX2g6ruqhj2S7IMoGavisGP7C4xaYkD3KjM5obXvWaEgphBlvotGk8D2z9GbtgVNKGpTyX5JLvceUo4FGFWHtHlXwEYtLAFi8BP_gD0BkCspXEra9CdGx7JS-hwKDzbDmtVH1NoOAMdMpk0SySjay_TNrj-qCx7UuHkusqumgA2aoWWz-W_HEy6KJnRw-nQjBYsz3hm380QI4-leusaaCt-hXAQc7gWpQ.cfFmJD-9FdeM7uS8.BegAuobF5oQuNyDAsWIFUx_kW7Tb4fyGjXAbyTNRQHIRuufZqNJAGBubkqw0zmY9M5Opmk8INy057U0PbtSOWfv9s5PC2cIGyqLpNa4L8X3o_E-ID_W0R1acX5f9QFv1iQA9YXUG9OBZ1stn6fP7wjO-YpAWZEQFkj45Mnjwp2P1cB63BO3GX8l26qKkP7dvcH_-y8aJ6DtBle0zVm0HZmtipaU5rfN0-U13ffEG9RXe0pUWyBngwRe6ZLEca2pe9NUNllFUtiUnuoe_P4qZ2797Ocvrlx7r8wzAzfvzMNYzFWLXweKjN4Zfp5eeH7DVVBJoeSLuNfUeCDI3K5T0k2BTZDCpBYHJfulx-aaSmhwcXd4omqhgO6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
 +  }, 
 +  { 
 +    "rate": 118.0, 
 +    "dateFrom": "2022-03-11", 
 +    "dateTo": "2022-03-12" 
 +  } 
 +]
  
 </code> </code>
- 
-=== HTTP status kodovi === 
- 
-^HTTP kod^Opis^Revizija| 
-|200 OK|Uspešno generisan token.|24-11-13| 
-|401 Not Authorized|Predati kredencijali nisu ispravni.|24-11-13| 
-|403 Forbidden|Nemate pristup modulu ili nemate ulogu za korišćenje ovog zahteva.|24-11-13| 
-|404 Bad Request|Informacije koje šaljete na server nisu u odgovarajućem formatu.|24-11-13| 
-|500 Internal Server Error|Nepoznata greška servisa.|24-11-13| 
- 
- 
  • kb/api_cer_list.1732095699.txt.gz
  • Last modified: 2024/11/20 09:41
  • by ognjen.bogicevic