aaa jasny, nevsim sem si ze ten odkaz na ten POST v fakturuid dokumentaci pro cloent credentials je klikaci a je tam priklad kde maj bejt jaky hodnoty. Bohuzel ted nejsem u pocitace, zkuste to sam a kdyby to neslo pastnu to vecer
Tak jsem se v těch složenejch zavorkach, jednoduchejch a dvojitejch uvozovkach dočista ztratil, furt mi to píše hlášku o invalidním JSON :-/
Mohl bych vas tedy poprosit o ukazku spravneho formatovani? moc díky!
curl -X POST "https://app.fakturoid.cz/api/v3/oauth/token" -H "Content-Type: application/json" -H "Authorization: Basic <BASE64 client_id:client:secret>" -H "Accept: application/json" --data '{"grant_type": "client_credentials"}' -v
# Do authorizacni hlavicky prijde vystup z tohoto prikazu:
echo "$client_id:$client_secret" | base64
Je to bez zaruky - fakturuid nepouzivam ale vypada to cajk:
$ curl -X POST "https://app.fakturoid.cz/api/v3/oauth/token" -H "Content-Type: application/json" -H "Authorization: Basic bXVqY2xpZW50Om1vanNlY3JldAo=" -H "Accept: application/json" --data '{"grant_type": "client_credentials"}' -v
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 174.138.100.186...
* TCP_NODELAY set
* Connected to app.fakturoid.cz (174.138.100.186) port 443 (#0)
.
> POST /api/v3/oauth/token HTTP/1.1
> Host: app.fakturoid.cz
> User-Agent: curl/7.64.1
> Content-Type: application/json
> Authorization: Basic <BASE64 client_id:client:secret>
> Accept: application/json
> Content-Length: 36
>
* upload completely sent off: 36 out of 36 bytes
< HTTP/1.1 401 Unauthorized
.
.
* Connection #0 to host app.fakturoid.cz left intact
{"error":"invalid_client"}* Closing connection 0
Tak už hlásí jen Invalid client
* We are completely uploaded and fine
* Connection state changed (MAX_CONCURRENT_STREAMS == 1024)!
< HTTP/2 401
< cache-control: no-store
< content-length: 26
< content-type: application/json; charset=utf-8
< pragma: no-cache
< referrer-policy: strict-origin-when-cross-origin
< strict-transport-security: max-age=63072000; includeSubDomains; preload
< vary: Accept-Encoding,Accept
< www-authenticate: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
< x-content-type-options: nosniff
< x-frame-options: SAMEORIGIN
< x-permitted-cross-domain-policies: none
< x-request-id: b33c4ac2-8035-4aa9-94d9-cb9d9e20c942
< x-runtime: 0.005270
< x-xss-protection: 0
< date: Fri, 12 Apr 2024 10:57:28 GMT
< alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400
<
* Connection #0 to host app.fakturoid.cz left intact
{"error":"invalid_client"}