function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sumit dsumit d 

invalid Access token in einstien

Hi All, 
         i  have a zip file named Fruits in my device in download folder.when i execute the command its showing invalid Access token
C:\>curl -X POST -H "Authorization: Bearer <JAJ2VY4FFSNPA4XNYJDUUSUEUHEMNO5QUGES2EVJARUKAHEAHECUBNCMYJFXSOHOVTG2OLX3QCYZ34VBOSE3GKU3GBTERVDGBIYJYZQ>" -H "Cache-Control: no-cache" -H "Content-Type: multipart/form-data" -F "type=text-intent" -F "path=http://einstein.ai/text/Fruits.zip" https://api.einstein.ai/v2/language/datasets/upload
{"message":"Invalid access token"}
how to overcome this issue Any suggestions?
Khan AnasKhan Anas (Salesforce Developers) 
Hi Sumit,

Greetings to you!

You see this error if your token has expired. If you get this error in the code, you’ll need to increase the expiration time or add code to refresh the token. If you generated the token from our page, go there to upload your key and generate a new token.

Please refer to below links which can help you further.

https://help.salesforce.com/articleView?id=000250225&type=1

https://trailhead.salesforce.com/en/content/learn/modules/einstein_intent_basics/einstein_intent_basics_env


I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Thanks and Regards,
Khan Anas
sumit dsumit d
Hi 
the token is not expired but its still giving me error. i am using command prompt
Any suggestions?
Vinod GandlaVinod Gandla
Hi Sumit,

I am also facing the same issue. If you have found the solution, please let me know.

Thanks in advance.
sumit dsumit d
Hi vinod,
which editor r u using?
try it with postman. with regenerating the token
Thanks.
Sylvain COPPINSylvain COPPIN

Hi,

I am also facing the same issue.

curl -X POST -H "Authorization: Bearer CdS4OSsi30DKyGWRbJVpFYOb" -H "Cache-Control: no-cache" -H "Content-Type: multipart/form-data" -F "type=text-intent" -F "path=http://einstein.ai/text/case_routing_intent.csv" https://api.einstein.ai/v2/language/datasets/upload

{"message":"Invalid access token"}

I tried with postman and I have the same error. 

If you have found the solution, please let me know.

Many thanks,

Sylvain