Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added source/images/images/api_integration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 31 additions & 14 deletions source/includes/_account_inquiry.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,28 +110,45 @@ Request request = new Request.Builder()
Response response = client.newCall(request).execute();
```

```javascript
```nodejs
const https = require('https');

var data = JSON.stringify({
"bank_code": "014",
"account_number": "1280259361"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
var options = {
host: '%7B%7Bbase_url%7D%7D',
path: '/api/account-inquiry',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Accept':'application/json',
'x-oy-username':'{{username}}',
'x-api-key':'{{api-key}}'
}
});
}

xhr.open("POST", "%7B%7Bbase_url%7D%7D/api/account-inquiry");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("x-oy-username", "{{username}}");
xhr.setRequestHeader("x-api-key", "{{api-key}}");
const req = https.request(options, (resp) => {
let data = '';

// A chunk of data has been received.
resp.on('data', (chunk) => {
data += chunk;
});

// The whole response has been received. Print out the result.
resp.on('end', () => {
console.log(JSON.parse(data).explanation);
});

}).on("error", (err) => {
console.log("Error: " + err.message);
});

xhr.send(data);
req.write(data)
req.end
```

```php
Expand Down
5 changes: 4 additions & 1 deletion source/index.html.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ language_tabs: # must be one of https://git.io/vQNgJ
- dart
- go
- java
- javascript
- nodejs
- php
- python

Expand Down Expand Up @@ -40,6 +40,9 @@ code_clipboard: true

Welcome to OY! API Documentation. Our API services are organized around [REST](https://en.wikipedia.org/wiki/Representational_state_transfer), accepts [form-encoded](https://en.wikipedia.org/wiki/POST_(HTTP)#Use_for_submitting_web_forms) request bodies and returns [JSON-encoded](https://www.json.org/json-en.html) responses.


![API Integration](images/images/api_integration.png)

# Definition

For the purpose of standardization and to prevent any misunderstanding, below our the terms we are going to use in this documentation:
Expand Down