Usage
Last updated
Last updated
The api_key
following is provided and configured:
Instructions for using the commands export
and curl
are provided when running in terminal on Linux or Mac operating systems. In case you use another environment, please replace them with equivalent operations.
A typical API call looks like this:
All requests use HTTPS protocol, POST method and pass values in body using data format application/json
. Required headers are Content-Type
and Authorization
.
The response uses the data format application/json
set in the header Content-Type
. If the request is successful, the HTTP status code is 200
. If the request fails, the HTTP status code can be . 4xx
or . 5xx
with a structure similar to the following:
The connection is done according to the redirect model. The partner needs to prepare a URL to receive the redirect after the shop is successfully created:
Process of connecting to the shop:
Send request to .Shop/AuthorizeShop.
Redirect to the url provided by auth_url
, wait for the shop to verify the account and receive redirect from eTelecom.
Resend request with shop_id
receipt.
Save shop_id
and auth_token
use in other APIs
Request body structure:
email required
string
The email address of the shop account to be created.
phone required
string
The phone of the shop account to be created.
name required
string
The name address of the shop account to be created.
redirect_url required
string
Redirect after shop successfully logged in
200 OK type=shop_request
This result means that the shop will be asked to log in to verify the account. The returned result will provide a url address with the field auth_url
for the partner to redirect the shop to and verify the account.
After performing account authentication, eTelecom will redirect to the partner's provided url address with shop_id
the following structure: $REDIRECT_URL?token=<token>&shop_id=<shop_id>
.
shop_key
informationThe shop_id
information is returned in the redirect_url
when the partner successfully creates a shop during the shop account connection process:
Partners still need to provide redirect_url
because there may be situations where the shop needs to log in again. This redirect_url
will be used for eTelecom to redirect after the shop successfully logs in.
Request body structure:
shop_id required
string
The ID of the shop.
redirect_url required
string
Redirect after shop successfully logged in
200 OKtype=shop_key
This result means that the partner can create a switchboard or send zns as a shop. Please save it auth_token
with your shop account to continue using it.
Note: It should be noted that even if the shop has been connected to eTelecom, the shop may still be asked to log in again. This situation occurs when the shop has unlinked the partner's account. At this time, the response will be available type=shop_request
and auth_url
returned, the partner needs to redirect to this address for the shop to log in again.
Return data attribute structure:
auth_token
string
Authorization code
auth_url
string
Authorization Path
code
string
State of success or failure
expires_in
int
Expiration time
meta
object
Properties if any
msg
string
API Description
shop_key
To check that shop_key
the received information is correct, the partner can send a request to:
Request:
Response:
Return data attribute structure:
id
string
Account ID
name
string
Account Name
type
string
Account Type: Partner
Shop
400 Bad Request
Please double check the provided values.
401 Unauthorized
Please double check that the request includes the Authorization: <api_key>
correct headers.
403 Forbidden
The shop has never logged intoeTelecom through the partner system. Please try again with a request that does not include shop_id
.
Note : In case the shop has logged into eTelecom through the partner's system, then removed the link with the partner, the result is still 200 OK
with the request for the shop to log in and grant permission again. So the error permission_denied
only occurs when shop_id
the information provided is incorrect.
404 Not Found
Please check the path and header again Content-Type: application/json
.
A successful response