OKX api_v5
I can get the following via the api - demo and live:
Account information
Coin balance
Market info
Candlestick info
I am trying to place a demo order with api.
Error -- The documentation says it's possible to trade via api
(
[clOrdId] =>
[ordId] =>
[sCode] => 51010
[sMsg] => The current account mode does not support this API interface.
[tag] =>
)
Call
[curl_params] => {"instId":"BTC-USDT-SWAP","sz":2,"side":"buy","px":21396.1,"ordType":"limit","tdMode":"isolated","uly":"BTC-USDT"}
[curl_method] => POST
[curl_url] => https://www.okx.com/api/v5/trade/order
Extra info - Some of the headers
[5] - just to show the raw signed info
[0 - 3] [REMOVED_SIGNED_DETAILS]
[4] => OK-ACCESS-TIMESTAMP: 2022-06-26T01:59:42.614Z
[5] => SIGN: 2022-06-26T01:59:42.614ZPOST/api/v5/trade/order{"instId":"BTC-USDT-SWAP","sz":2,"side":"buy","px":21396.1,"ordType":"limit","tdMode":"isolated","uly":"BTC-USDT"}
[6] => x-simulated-trading: 1
Has anyone been able to do the demo trading with the api?
Does anyone see anything wrong with the request?
Thank you
swatch trade tab, open settings, you can change account mode from simple to single currency margin
Related
I'm developing a wordpress plugin, which obtains certain product info from the Lightspeed Retail API. I followed the steps in the documentation here http://developers.lightspeedhq.com/retail/authentication/access-token/
I have the Client ID and Client Secret, but I dont have the Temporary Token, I am stuck at this point, I am sure I'm missing some procedure here, can you help me?
This is the current code I use based on the API documentation:
...
$tokenURL = "https://cloud.lightspeedapp.com/oauth/access_token.php";
$postFields = [
'client_id' => 'XXXXXXXXXXXXX',
'client_secret' => 'XXXXXXXXXXXXX',
'code' => 'Temporary Token',
'grant_type' => 'authorization_code'
];
...
The temporary token is returned if you follow the instructions here.
You need to start using this URL:
https://cloud.lightspeedapp.com/oauth/authorize.php?response_type=code&client_id={client_id}&scope={scope}&state={state}
which will return after your app is accepted with a code/temporary token.
I'm using the Google API client library for PHP to create Google Surveys. I'm able to create surveys, but not start them. The error I receive is:
Array ( [0] => Array ( [domain] => global [reason] => BILLING_TRANSACTION_ERROR [message] => Billing Transaction Error: Current user is not configured for post-payment..
I've set up a billing account # https://console.cloud.google.com/billing and see my project linked to the account, but am still getting this error.
Any help would be appreciated!
I'm on the Google Surveys team. To start and stop surveys with the API, you'll need to have an established sales relationship with us. Please email surveys-api#google.com for more information on getting set up with that.
I cant seem to get a proper return of company updates (shares) via the LinkedIn API: https://developer.linkedin.com/reading-company-shares
When I make a request for company updates with event type "new-hire" of lets say The Coca Cola company my endpoint is:
api.linkedin.com/v1/companies/1694/updates?event-type=new-hire
This gives me a result of 0
[#attributes] => Array
(
[total] => 0
)
However when making a request for company updates with event type "status update" my endpoint is:
api.linkedin.com/v1/companies/1694/updates?event-type=status-update
This gives no result but a status 500 API sever error.
[status] => 500
[timestamp] => 1390384395039
[request-id] => 2O14IFML4X
[error-code] => 0
[message] => Internal API server error
Am I doing something wrong? Is my API endpoint not correct? Or is this a LinkedIn API bug. I've found posts of other developers having similar problems.
You need to use oauth2_access_token to get data like this https://api.linkedin.com/v1/companies/id/updates?oauth2_access_token=access_token&format=json&event-type=job-posting&count=250
I am unable to create Paypal sandbox test account with option PayPal Payments Pro (Use to represent yourself as a merchant using Pro). I selected the option during test account creation but when I viewed the details of that account, then it displayed
Account Type : Seller (Use to represent yourself as the merchant).
Please help me as I am unable to do credit card payment integration using sandbox as it is showing
error :
Array
(
[TIMESTAMP] => 2013-02-06T10:40:57Z
[CORRELATIONID] => 2732f8af3ec70
[ACK] => Failure
[VERSION] => 85.0
[BUILD] => 5060305
[L_ERRORCODE0] => 10501
[L_SHORTMESSAGE0] => Invalid Configuration
[L_LONGMESSAGE0] => This transaction cannot be processed due to an invalid merchant configuration.
[L_SEVERITYCODE0] => Error
[AMT] => 100.00
[CURRENCYCODE] => USD
)
Thanks in advance.
The API credentials in the Sandbox environment uses the default buyer account you have. You need to make sure to use the “payments pro” option when you create a buyer account in the sandbox environment. You’ll then see a new set of API credentials under API credentials…
Steps below:
Go to the link https://developer.paypal.com/us/cgi-bin/devscr?cmd=_sandbox-acct-session and login with your sandbox credentials
And click on the link Preconfigured which will take you to https://developer.paypal.com/us/cgi-bin/devscr?cmd=_create-account-session
From the options select Website Payments Pro (Use to represent yourself as a merchant using Pro) and create a Test Account and use these details for sandbox
Before sending an email to a google account my script looked up the MX records for google's email servers. The results are:
gmail-smtp-in.l.google.com
alt1.gmail-smtp-in.l.google.com
alt2.gmail-smtp-in.l.google.com
alt3.gmail-smtp-in.l.google.com
alt4.gmail-smtp-in.l.google.com
I then successfully connected to gmail-smtp-in.l.google.com and after EHLO I started a STARTTLS request to switch to SSL. However, I set the script to check and make sure the host(s) listed in the certificate match the domain I was connecting too.
stream_context_set_option($fh, 'ssl', 'CN_match', 'gmail-smtp-in.l.google.com`);
However, this is where things break. I got the following error:
stream_socket_enable_crypto(): Peer certificate CN='mx.google.com' did not match expected CN='gmail-smtp-in.l.google.com'
I checked to find out where nslookup mx.google.com was located and found it doesn't exist.
Server: 127.0.0.1
Address: 127.0.0.1#53
** server can't find mx.google.com: NXDOMAIN
Why doesn't the SSL certificate match the domains using it? Am I missing something?
The following is the cert my script received from them.
Array
(
[name] => /C=US/ST=California/L=Mountain View/O=Google Inc/CN=mx.google.com
[subject] => Array
(
[C] => US
[ST] => California
[L] => Mountain View
[O] => Google Inc
[CN] => mx.google.com
)
[hash] => fbf7dda6
[issuer] => Array
(
[C] => US
[O] => Google Inc
[CN] => Google Internet Authority
)
[version] => 2
[serialNumber] => 280762463620984597407910
[validFrom] => 120912115656Z
[validTo] => 130607194327Z
[validFrom_time_t] => 1347451016
[validTo_time_t] => 1370634207
[purposes] => Array
(
[1] => Array
(
[0] => 1
[1] =>
[2] => sslclient
)
[2] => Array
(
[0] => 1
[1] =>
[2] => sslserver
)
[3] => Array
(
[0] => 1
[1] =>
[2] => nssslserver
)
[4] => Array
(
[0] =>
[1] =>
[2] => smimesign
)
[5] => Array
(
[0] =>
[1] =>
[2] => smimeencrypt
)
[6] => Array
(
[0] => 1
[1] =>
[2] => crlsign
)
[7] => Array
(
[0] => 1
[1] => 1
[2] => any
)
[8] => Array
(
[0] => 1
[1] =>
[2] => ocsphelper
)
)
[extensions] => Array
(
[extendedKeyUsage] => TLS Web Server Authentication, TLS Web Client Authentication
[subjectKeyIdentifier] => 69:B3:67:5C:04:7F:16:EF:C1:85:FB:E8:2D:E4:FC:21:E9:7D:93:AF
[authorityKeyIdentifier] => keyid:BF:C0:30:EB:F5:43:11:3E:67:BA:9E:91:FB:FC:6A:DA:E3:6B:12:24
[crlDistributionPoints] => URI:http://www.gstatic.com/GoogleInternetAuthority/GoogleInternetAuthority.crl
[authorityInfoAccess] => CA Issuers - URI:http://www.gstatic.com/GoogleInternetAuthority/GoogleInternetAuthority.crt
[basicConstraints] => CA:FALSE
[subjectAltName] => DNS:mx.google.com
)
)
There are two possible reasons for this.
Firstly SMTP host name matching has traditionally been defined quite vaguely. You can check the historical notes about this in RFC 6125 (a recent RFC about best practicises for host name verification, not yet widely implemented). RFC 3207 (Secure SMTP over Transport Layer Security) doesn't give much details as to where the host name should be in the certificate. RFC 4954 (SMTP Service Extension for Authentication) gives more details and talks about Subject Alternative Names, but it's in the context of SASL. Ambiguous or vague host name matching specifications are often a reason why no correct attempt to match the host name is made at all, unfortunately.
Secondly, SSL/TLS is rarely used between Mail Transfer Agents (MTA). What you're doing by getting the MX DNS record and trying to send an e-mail directly to it is typically done my MTAs, not so much by a Mail Submission Agent.
Typical usage of SSL/TLS for SMTP is between a Mail User Agent (the e-mail client) and a Mail Submission Agent (your ISP's e-mail server, where you have to authenticate).
SSL/TLS between MTAs is hard to set up, because not every server supports it and it's hard to know which MTAs will support it. Some people advocate "optimistic TLS" support, whereby you try to see whether the server you're talking to supports TLS and fall back to plain SMTP if it doesn't. There's unfortunately little to gain by doing so, since you're obviously vulnerable to MITM attacks as soon as you're willing to downgrade anyway.
In addition, the MX entry you get may itself have been compromised (at least without DNSSEC).
Overall, this actually makes it quite hard to rely on any form of transport security for e-mail beyond the MUA/MSA connection. This probably explains why there's little emphasis on configuring MX servers properly for SSL/TLS.