Skip to content

Commit

Permalink
added oauth endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
amirsalarsafaei committed Aug 19, 2023
1 parent 830422c commit 0a46782
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 40 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

.history/
*.vsix
*~
Expand Down
8 changes: 0 additions & 8 deletions .idea/.gitignore

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/inspectionProfiles/profiles_settings.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/kenar-docs.iml

This file was deleted.

4 changes: 0 additions & 4 deletions .idea/misc.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

39 changes: 39 additions & 0 deletions oauth/approved_addon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
### الصاق افزونه تایید شده

| CREATE APPROVED ADDON | |
|-----------------------|---------------------|
| API Permissions | ADD_ON_CREATE |
| OAuth Permissions | ADDON_USER_APPROVED |

با استفاده از access_token می توانید شماره همراه کاربر احراز شده را دریافت کنید. کافیست رکوئست زیر را بزنید.
```http request
POST https://api.divar.ir/v1/open-platform/users
Content-Type: application/json
x-api-key: {{apikey}}
x-access-token: {{access_token}}
{
"widgets": {
"widget_list": [
{
"widget_type": "LEGEND_TITLE_ROW",
"data": {
"@type": "type.googleapis.com/widgets.LegendTitleRowData",
"title": "کارشناسی دمپایی",
"subtitle": "کارشناسی",
"has_divider": true,
"image_url": "logo"
}
}
]
}
}
```

ریسپانس

```json
{
"id": "123"
}
```
21 changes: 21 additions & 0 deletions oauth/get_user.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
### گرفتن اطلاعات کاربر


| GET USER | |
|-------------------|---------------|
| API Permissions | USER_RETRIEVE |
| OAuth Permissions | USER_PHONE |

با استفاده از access_token می توانید شماره همراه کاربر احراز شده را دریافت کنید. کافیست رکوئست زیر را بزنید.
```http request
POST https://api.divar.ir/v1/open-platform/users
Content-Type: application/json
x-api-key: {{apikey}}
x-access-token: {{access_token}}
```
نمونه پاسخ نیز مانند زیر است.
```json5
{
"phone_numbers": ["09990000000"]
}
```

0 comments on commit 0a46782

Please sign in to comment.