How do I create an API access_token in SuiteCRM?

830 Views Asked by At

How do I create an API access_token in SuiteCRM?

Their documentation has prerequisites of 1) Install composer, 2) creating private and public keys for Oauth2, and 3) optionally changing the Oauth encryption key. I have completed all three. I don't know what to do next. Their documentation for non-developers like me is difficult to follow.

Server: AWS Linux2, SuiteCRM 7.10.27, Apache, MySQL 5.7.*

1

There are 1 best solutions below

1
On
  1. Install composer. done
  2. creating private and public keys for Oauth2. done
  3. optionally changing the Oauth encryption key. done
  4. Go to Admin, then OAuth2 Clients and Tokens
  5. Create New Password Client (remember the pass)
  6. Profit, I am attaching a curl example to my localhost instance accommodate please

curl example, change HOST, CLIENT_ID, USER and PASS

 curl --request POST \
  --url http://localhost:8080/Api/access_token \
  --header 'accept: application/json' \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data scope= \
  --data grant_type=password \
  --data client_id=113c04ed-075f-5b0a-35ea-5f8cc9c24399 \
  --data client_secret=YourSecPass \
  --data username=admin \
  --data password=otherSecPass

Good luck