user@:~$ curl --verbose --insecure --location --re...
# troubleshoot
c
user@:~$ curl --verbose --insecure --location --request POST 'https//<>9002/api/v2/graphql' \
--header 'X-DataHub-Actor: urnlicorpuser:datahub' \
--header 'Content-Type: application/json' \
--data-raw '{ "query":"mutation { createAccessToken(input: { type: PERSONAL, actorUrn: \"urnlicorpuser:datahub\", duration: ONE_HOUR, name: \"my personal token\" } ) { accessToken metadata { id name description} } }", "variables":{}}'
Note: Unnecessary use of -X or --request, POST is already inferred. * Trying ip:9002... * TCP_NODELAY set * Connected to ip (ip) port 9002 (#0) * ALPN, offering h2 * ALPN, offering http/1.1 * successfully set certificate verify locations: * CAfile: /etc/ssl/certs/ca-certificates.crt CApath: /etc/ssl/certs * TLSv1.3 (OUT), TLS handshake, Client hello (1): * TLSv1.3 (IN), TLS handshake, Server hello (2): * TLSv1.2 (IN), TLS handshake, Certificate (11): * TLSv1.2 (IN), TLS handshake, Server key exchange (12): * TLSv1.2 (IN), TLS handshake, Server finished (14): * TLSv1.2 (OUT), TLS handshake, Client key exchange (16): * TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1): * TLSv1.2 (OUT), TLS handshake, Finished (20): * TLSv1.2 (IN), TLS handshake, Finished (20): * SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384 * ALPN, server did not agree to a protocol * Server certificate: * subject: <> * start date: Mar 29 075254 2023 GMT * expire date: Jan 7 075254 2025 GMT * issuer: <> * SSL certificate verify result: self signed certificate in certificate chain (19), continuing anyway.
POST /api/v2/graphql HTTP/1.1
Host: <>
User-Agent: curl/7.68.0
Accept: /
X-DataHub-Actor: urnlicorpuser:datahub
Content-Type: application/json
Content-Length: 223
* upload completely sent off: 223 out of 223 bytes * Mark bundle as not supporting multiuse < HTTP/1.1 401 Unauthorized < Date: Thu, 01 Jun 2023 082932 GMT < Content-Length: 0 <
g
Hi @crooked-state-81977 Please try below command
Copy code
curl --verbose --location --request POST '<http://localhost:8080/api/graphql>' --header 'X-DataHub-Actor: urn:li:corpuser:datahub' --header 'Content-Type: application/json' --data-raw '{ "query":"mutation { createAccessToken(input: { type: PERSONAL, actorUrn: \"urn:li:corpuser:datahub\", duration: ONE_HOUR, name: \"my personal token\" } ) { accessToken metadata { id name description} } }", "variables":{}}'