Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit 07ca393

Browse files
authored
Merge pull request #154 from hubert-deriv/review_tech_content_pages
2 parents 725eb08 + ecfd213 commit 07ca393

File tree

16 files changed

+192
-193
lines changed

16 files changed

+192
-193
lines changed

docs/_client-libraries/_category_.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"label": "Client Libraries",
2+
"label": "Client libraries",
33
"position": 5,
44
"link": {
55
"type": "generated-index",

docs/_client-libraries/flutter/project-setup/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Project Setup
2+
title: Project setup
33
sidebar_label: Setup
44
sidebar_position: 0
55
---

docs/_client-libraries/typescript/project-setup/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Project Setup
2+
title: Project setup
33
sidebar_label: Setup
44
sidebar_position: 0
55
---

docs/_terminology/trading/landing-company-calls/landing-company/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ The company has a number of licensed subsidiaries in various jurisdictions, whic
2323

2424
This call will return the appropriate Landing Company for clients of a given country.
2525

26-
The landing company may differ for Gaming contracts (Synthetic Indices) and Financial contracts (Forex, Stock Indices, Commodities).
26+
The landing company may differ for Synthetic Indices and Financial contracts (Forex, Stock Indices, Commodities).
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"label": "Javascript Examples",
2+
"label": "JavaScript Examples",
33
"position": 1,
44
"link": {
55
"type": "generated-index",
6-
"description": "Javascript code examples"
6+
"description": "JavaScript code examples"
77
}
88
}

docs/core-concepts/_category_.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"label": "Core Concepts",
2+
"label": "Core concepts",
33
"position": 2,
44
"link": {
55
"type": "generated-index",
6-
"description": "Learn core concepts of Deriv API websocket server and it's features"
6+
"description": "Learn core concepts of the Deriv API WebSocket server and its features"
77
}
88
}

docs/core-concepts/api-calls-anatomy/index.md

Lines changed: 36 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
---
2-
title: API Calls Anatomy
3-
hide_title: true
2+
title: API calls' anatomy
3+
hide_title: false
44
draft: false
5-
sidebar_label: API Calls anatomy
5+
sidebar_label: API calls' anatomy
66
sidebar_position: 1
77
tags:
88
- concept
9+
- calls
10+
- anatomy
911
keywords:
1012
- trading
1113
- concept
12-
description: Deriv API calls Anatomy
14+
- calls
15+
- anatomy
16+
description: Deriv API calls' anatomy
1317
---
14-
## Subscribe and Send
18+
## Subscribe and send
1519

1620
All API calls have a send functionality for making a request and receiving a response. Certain API calls also offer a subscribe functionality allowing for updates to be sent to your application when new information becomes available.
1721

@@ -23,42 +27,42 @@ Some of these API calls automatically subscribe (e.g. [ticks](https://api.deriv.
2327

2428
For example, you can call [Tick History](https://api.deriv.com/api-explorer#ticks_history) to receive tick history data. But when you add the `subscribe` option to this call, you will receive the tick history data you requested in the first response, and you will continue to receive a new response every time there is a new tick published by the server for the given symbol.
2529

26-
In the message stream from `subscribe` there is a field called `subscription`, this is the `Stream ID`. with this ID you can identify the message stream in your logic and stop the stream with `Forget` and `Forget All` API calls.
30+
In the message stream from `subscribe`, there is a field called `subscription`. This is the `Stream ID`. With this ID, you can identify the message stream in your logic and stop the stream with `Forget` and `Forget All` API calls.
2731

2832
The data provided by API calls with the `subscribe` functionality can be used as a data source for other API calls and features.
2933

3034
### Send
3135

32-
If you call the API with the `send` functionality, then the server will only send back the requested data one time. In order to get updated data you have to send the API call again. Usually, this method is used when you get other API call responses or UI events such as `Click`, `Scroll` and more.
36+
If you call the API with the `send` functionality, then the server will only send back the requested data one time. In order to get updated data, you have to send the API call again. Usually, this method is used when you get other API call responses or UI events such as `Click`, `Scroll`, and more.
3337

3438
### Forget
3539

36-
If you want to stop the message Stream created by `subscribe`, you will have to call the `Forget` API call with the correct `Stream ID`. Otherwise, you can use the `Forget All` API call to stop streams by their `Method name`.
40+
If you want to stop the message stream created by `subscribe`, you will have to call the `Forget` API call with the correct `Stream ID`. Otherwise, you can use the `Forget All` API call to stop streams by their `Method name`.
3741

3842
:::caution
39-
For more information on the `Forget` API call, you can have a look at [Forget](https://api.deriv.com/api-explorer#forget) and [Forget All](https://api.deriv.com/api-explorer#forget_all) in the API explorer.
43+
For more information on the `Forget` API call, have a look at [Forget](https://api.deriv.com/api-explorer#forget) and [Forget All](https://api.deriv.com/api-explorer#forget_all) in the API explorer.
4044
:::
4145

4246

43-
## Request Data
47+
## Request data
4448

45-
In order to make it easier for you to handle the `request` and `response` flow of your websocket connection, every deriv websocket API calls has a general structure. you can use it for caching, validation, request and response synchronization are some of the things you can use it for.
49+
To make it easier for you to handle the request and response flow of your WebSocket connection, each Deriv WebSocket API call follows a standardised structure. You can use it for caching, validation, request, and response synchronisation.
4650

47-
#### API Call Method Name
51+
#### API call method name
4852

4953
Every `request` in the WebSocket API includes a `method name` field that serves as a unique identifier for the request. In most cases, this `method name` will get a numerical value of `1`. However, there are some cases where the identifier property may have a string value.
5054

5155
:::caution
52-
API Call Method Name is always required. this field determines the data you'll get from our websocket server.
56+
API Call Method Name is always required. this field determines the data you'll get from our WebSocket server.
5357
:::
5458

55-
### Required Fields
59+
### Required fields
5660

57-
Every request data has several required fields which you must provide them and they may contain optional fields as well, let's explore this with an example on `Residence List`:
61+
Each request data has mandatory fields that you must provide, and it may also include optional fields. Let's explore this with an example from `Residence List`.
5862

59-
`Residence List` Call returns a list of countries and 2-letter country codes, suitable for populating the account opening form.
63+
A `Residence List` call returns a list of countries and 2-letter country codes, suitable for populating the account opening form.
6064

61-
Request data for this call is like so:
65+
The request data for this call is as below:
6266

6367
```ts
6468
{
@@ -68,27 +72,27 @@ Request data for this call is like so:
6872
}
6973
```
7074

71-
The `residence_list` field is the `method name` for the call and is required. There may be other required fields which are related to this type of the request you want to send. if you want to know more about `Residence List` and other API calls please check them out in the [API Explorer](https://api.deriv.com/api-explorer#residence_list).
75+
The `residence_list` field is the `method name` for the call and is required. There may be other required fields related to this type of the request you want to send. To know more about `Residence List` and other API calls, please check them out in [API Explorer](https://api.deriv.com/api-explorer#residence_list).
7276

73-
### Optional Fields
77+
### Optional fields
7478

75-
Every Call has several `Optional` fields as well, `passthrough` and `req_id` are always part of the request data but you can choose to opt-out and not use them.
79+
Every call has several `Optional` fields as well. `Passthrough` and `req_id` are always part of the request data but you can choose to opt out and not use them.
7680

77-
#### `passthrough` Field
81+
#### The `passthrough` field
7882

79-
Whatever you pass to this field will be returned back to you inside a `response` object, this can be helpful when you need to simulate a stateful flow for your `requests` and `responses`.
83+
Whatever you pass to this field will be returned back to you inside a `response` object. This can be helpful when you need to simulate a stateful flow for your `requests` and `responses`.
8084

81-
#### `req_id` Field
85+
#### The `req_id` field
8286

83-
You may need to `tag` your requests and pass them through our `websocket` calls. you can do it by passing a `number` to this field. it can be helpful when you need to map `requests` to `responses`.
87+
You may need to `tag` your requests and pass them through our `WebSocket` calls. You can do so by passing a `number` to this field. it can be helpful when you need to map `requests` to `responses`.
8488

8589
:::caution
86-
There may be other optional fields for a request which are only related to that API call, please check our [API Explorer](https://api.deriv.com/api-explorer) to get familiar with them.
90+
To learn about additional optional fields specific to each API call, please refer to our [API Explorer](https://api.deriv.com/api-explorer).
8791
:::
8892

89-
## Response Data
93+
## Response data
9094

91-
When you get the response for the call, there will be a `Field` with the same name as the `method name`. and it contains the actual data.
95+
When you get the response for the call, there will be a `Field` with the same name as the `method name`, which contains the actual data.
9296

9397
The response for the `Residence List` call:
9498

@@ -159,15 +163,15 @@ The response for the `Residence List` call:
159163
};
160164
```
161165

162-
Here the `residence_list` is the `method name` and it contains the actual data you requested. rest of the array is removed here for brevity sake, you can check the actual response [here](https://api.deriv.com/api-explorer#residence_list).
166+
Here the `residence_list` is the `method name`, and it contains the actual data you requested. To keep it short, we haven't included the rest of the array. You can check the actual response [here](https://api.deriv.com/api-explorer#residence_list).
163167

164-
#### The `echo_req` Field
168+
#### The `echo_req` field
165169

166170
This `Field` contains the exact `Request Data` you sent to the server.
167171

168-
#### The `msg_type` Field
172+
#### The `msg_type` field
169173

170-
This `Field` helps you determine which `message` data you're getting on the message event of the websocket connection. For example, your `onmessage` event handler for your websocket connection in `Javascript` would be:
174+
This `Field` helps you determine which `message` data you're getting on the message event of the WebSocket connection. For example, your `onmessage` event handler for your WebSocket connection in `JavaScript` would be:
171175

172176
```js
173177
socket.onmessage = (event) => {
@@ -186,7 +190,7 @@ socket.onmessage = (event) => {
186190
}
187191
```
188192

189-
#### The `req_id` Field
193+
#### The `req_id` field
190194

191195
This is the `Optional` passed to the `Request Data`, you can use it for `validation`, `synchronization`, `caching`, etc.
192196

docs/core-concepts/authorization-authentication/index.md

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,74 @@
11
---
2-
title: Authorization and Authentication
2+
title: Authorisation and authentication
33
hide_title: false
44
draft: false
5-
sidebar_label: Authorization and Authentication
5+
sidebar_label: Authorisation and authentication
66
sidebar_position: 2
77
tags:
88
- authentication
9-
- authorization
9+
- authorisation
1010
keywords:
1111
- deriv-authentication
12-
- deriv-authorization
13-
description: deriv api authentication and authorization
12+
- deriv-authorisation
13+
description: Deriv API authorisation and authentication
1414
---
15-
16-
Without authentication and authorization you'll only get access to roughly half of our API calls and features. for example in order to buy contracts or utilize the `Copy Trading` features your users must be authenticated and authorized by our **OAuth** provider and **Websocket Server**.
15+
Without authorisation and authentication you'll only get access to roughly half of our API calls and features. For example, in order to buy contracts or utilise the `Copy Trading` features, your users must be authenticated and authorised by our **OAuth** provider and **WebSocket Server**.
1716

1817
## Before we start
1918

20-
You have to make sure you have all the requirements mentioned bellow to continue.
19+
Please make sure you have all the requirements mentioned below to continue.
2120

2221
### Requirements
2322

24-
1. Deriv Account
25-
2. Deriv API Token with the appropriate access level
26-
3. Deriv App ID
23+
1. Deriv account
24+
2. Deriv API token with the appropriate access level
25+
3. Deriv app ID
2726

2827
:::note
29-
Please refer to [Setting up a Deriv Application](/docs/setting-up-a-deriv-application.md) for detailed instruction how to create Deriv API token and Applications
28+
Please refer to [Setting up a Deriv application](docs/setting-up-a-deriv-application.md) for detailed instructions how to create a Deriv API token and application.
3029
:::
3130

32-
### API Token
31+
### API token
3332

34-
An API token is a unique identifier of a client that requests access from a server. It's the simplest way of authorization.
33+
An API token is a unique identifier of a client that requests access from a server. It's the simplest way of authorisation.
3534

3635
The access level for each API token has to match the required access level of each API call, which can be found in the [API Explorer](https://api.deriv.com/api-explorer) as well.
3736

3837
For example, on the screenshot below, you can see that to be able to use the Account Status, a token with read access level must be used.
3938

4039
![](/img/acc_status_scope_api_explorer.png)
4140

42-
Following the authorization of a Websocket connection, subsequent calls on that connection will be considered user actions.
41+
Following the authorisation of a WebSocket connection, subsequent calls on that connection will be considered user actions.
4342

4443
Please bear in mind that the API token can be used with any app, so both your app and your clients need to keep it secure.
4544

4645
### OAuth2
4746

48-
OAuth stands for Open Authorization - a protocol that allows a client access resources hosted on a server on behalf of the user without revealing the credentials.
47+
OAuth stands for `Open Authorisation` a protocol that allows a client to access resources hosted on a server on behalf of the user without revealing the credentials.
4948

50-
This type of authorization allows clients to log in to third-party apps using their Deriv accounts without creating an API token. In this case, the third-party app does not see the user's password or permanent API token, which makes it safer.
49+
This type of authorisation allows clients to log in to third-party apps using their Deriv accounts without creating an API token. In this case, the third-party app does not see the user's password or permanent API token, which makes it safer.
5150

5251
The OAuth2 authentication requires more steps to set up, but it is the safest way for developers to share access to their app with their clients.
5352

5453
For more information on OAuth2, visit [this guide](https://aaronparecki.com/oauth-2-simplified/).
5554

56-
Here is the visual representation of how the OAuth authorization connection works:
55+
Here is the visual representation of how the OAuth authorisation connection works:
5756

5857
![OAuth flow](/img/how_oauth_works.png 'OAuth flow')
5958

60-
## Authentication Process
59+
## The authentication process
6160

62-
In order to Authenticate your user, specify the URL that will be used as the OAuth Redirect URL on the [Dashboard](/dashboard) page, **Register application** tab in the **OAuth details** fields and then Add a login button on your website or app and direct users to **`https://oauth.binary.com/oauth2/authorize?app_id=your_app_id`** where your_app_id is the ID of your app.
61+
In order to authenticate your user, specify the URL that will be used as the OAuth Redirect URL on the [Dashboard](/dashboard) page, **Register application** tab in the **OAuth details** fields. Then, add a login button on your website or app and direct users to **`https://oauth.binary.com/oauth2/authorize?app_id=your_app_id`** where your_app_id is the ID of your app.
6362

6463
![Deriv OAuth Login](/img/oauth_login.png 'Deriv OAuth Login')
6564

66-
Once a user signs up / signs in, they will be redirected to the URL that you entered as the Redirect URL. This URL will have arguments added to it with the user's session tokens, and will look similar to this:
65+
Once a user signs up/logs in, they will be redirected to the URL that you entered as the Redirect URL. This URL will have arguments added to it with the user's session tokens, and will look similar to this:
6766

6867
`https://[YOUR_WEBSITE_URL]/redirect/?acct1=cr799393& token1=a1-f7pnteezo4jzhpxclctizt27hyeot&cur1=usd& acct2=vrtc1859315& token2=a1clwe3vfuuus5kraceykdsoqm4snfq& cur2=usd`
6968

70-
## Authorization Process
69+
## The authorisation process
7170

72-
The query params in the redirect URL are the user's accounts and their related session tokens. you can map the query params to an array like so:
71+
The query parameters in the redirect URL are the user's accounts and their related session tokens. You can map the query parameters to an array using the following approach:
7372

7473
```js
7574
const user_accounts = [
@@ -85,17 +84,14 @@ const user_accounts = [
8584
},
8685
];
8786
```
88-
89-
To authorize the user, based on the user's **Selected** account, call the [authorize](https://api.deriv.com/api-explorer#authorize) API call with the user's **Selected** account **Session Token**:
90-
87+
To authorise the user based on the user's **selected** account, call the [authorize](https://api.deriv.com/api-explorer#authorize) API call with the user's **selected** account **session token**:
9188
```js
9289
{
9390
"authorize": "a1-f7pnteezo4jzhpxclctizt27hyeot"
9491
}
9592
```
9693

97-
The response for the `authorize` call would be an object like so:
98-
94+
The response for the `authorize` call would be an object as below:
9995
```js
10096
{
10197
"account_list": [
@@ -149,5 +145,4 @@ The response for the `authorize` call would be an object like so:
149145
"user_id": 12345678
150146
}
151147
```
152-
153-
Now user is authorized and you use Deriv API calls on behalf of the account.
148+
Now, the user is authorised, and you can use Deriv API calls on behalf of the account.

0 commit comments

Comments
 (0)