Еще раз здравствуйте. Сейчас пытаюсь получить access token через запрос curl. В результате выдает ошибку 400 неправильный запрос. Не подскажите, что делаю не так? Собственно сам запрос:
curl -v "
https://developer.api.autodesk.com/authentication/v1/gettoken" -X "POST" -H "Content-Type: application/x-www-form-urlencoded" -d "client_id=<client-id>&client_secret=<client-secret>&grant_type=authorization_code&code=T2HLv-X05tqRwfZrSwYsFwYMUTe73Udp-y2hGAId&redirect_uri=http://localhost/"
И вот ответ:
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 35.164.54.50...
* TCP_NODELAY set
* Connected to developer.api.autodesk.com (35.164.54.50) port 443 (#0)
* schannel: SSL/TLS connection with developer.api.autodesk.com port 443 (step 1/3)
* schannel: checking server certificate revocation
* schannel: sending initial handshake data: sending 191 bytes...
* schannel: sent initial handshake data: sent 191 bytes
* schannel: SSL/TLS connection with developer.api.autodesk.com port 443 (step 2/3)
* schannel: failed to receive handshake, need more data
* schannel: SSL/TLS connection with developer.api.autodesk.com port 443 (step 2/3)
* schannel: encrypted data got 2600
* schannel: encrypted data buffer: offset 2600 length 4096
* schannel: encrypted data length: 2506
* schannel: encrypted data buffer: offset 2506 length 4096
* schannel: received incomplete message, need more data
* schannel: SSL/TLS connection with developer.api.autodesk.com port 443 (step 2/3)
* schannel: encrypted data got 1590
* schannel: encrypted data buffer: offset 4096 length 4096
* schannel: encrypted data length: 122
* schannel: encrypted data buffer: offset 122 length 4096
* schannel: received incomplete message, need more data
* schannel: SSL/TLS connection with developer.api.autodesk.com port 443 (step 2/3)
* schannel: encrypted data got 225
* schannel: encrypted data buffer: offset 347 length 4096
* schannel: sending next handshake data: sending 126 bytes...
* schannel: SSL/TLS connection with developer.api.autodesk.com port 443 (step 2/3)
* schannel: encrypted data got 51
* schannel: encrypted data buffer: offset 51 length 4096
* schannel: SSL/TLS handshake complete
* schannel: SSL/TLS connection with developer.api.autodesk.com port 443 (step 3/3)
* schannel: stored credential handle in session cache
> POST /authentication/v1/gettoken HTTP/1.1
> Host: developer.api.autodesk.com
> User-Agent: curl/7.55.1
> Accept: */*
> Content-Type: application/x-www-form-urlencoded
> Content-Length: 180
>
* upload completely sent off: 180 out of 180 bytes
* schannel: client wants to read 102400 bytes
* schannel: encdata_buffer resized 103424
* schannel: encrypted data buffer: offset 0 length 103424
* schannel: encrypted data got 444
* schannel: encrypted data buffer: offset 444 length 103424
* schannel: decrypted data length: 415
* schannel: decrypted data added: 415
* schannel: decrypted data cached: offset 415 length 102400
* schannel: encrypted data buffer: offset 0 length 103424
* schannel: decrypted data buffer: offset 415 length 102400
* schannel: schannel_recv cleanup
* schannel: decrypted data returned 415
* schannel: decrypted data buffer: offset 0 length 102400
< HTTP/1.1 400 Bad Request
< Content-Type: application/json
< Date: Tue, 09 Jul 2019 11:18:47 GMT
< Content-Length: 273
< Connection: keep-alive
<
{"developerMessage":"The authorization code/refresh token is expired or invalid/redirect_uri must have the same value as in the authorization request.","userMessage":"","errorCode":"AUTH-004","more info":"
http://developer.api.autodesk.com/documentation/v1/errors/AUTH-004"}* Connection #0 to host developer.api.autodesk.com left intact
Хелп плз)))