I know that there is no documenation for the REST-API yet. We may help ourself by checking the requests the espocrm app uses but we want some commitment on which APIs we can rely for integration scenarios before we start. As a starting point we all may document what we find in a public Wiki and you comment if this is stable for public usage or subject of change (or a WikiPage inside the github project)?
Announcement
Collapse
No announcement yet.
documentation for public REST-API
Collapse
X
-
Generating auth-tokens- Get the output of below code as basicAuthToken
<?php
$userName = "myusername";
$password = "mypassword";
echo base64_encode($userName . ":" . $password);
?>- curl -H “Authorization: Basic basicAuthToken” -H “Espo-Authorization: basicAuthToken” “http://espocloud-ip: port/api/v1/App/user” | python -m json.tool > user_info.json
- Port is optional [Only if you have provided in server configuration]
- Search token keyword in user_info.json and copy its value
- The copied values is your actual AuthToken
Testing AuthToken
Open mysql consoleRun the below mysql Querymysql -u=mysql_user_name -pmysql_user_password -h=mysql_hostname --port=mysql_port espo_database Make an API request to Espo> SELECT `id` FROM `espo_database`.`contact` LIMIT 1; # Below curl request should give you a json response.
# Substitute id with above mysql query result.
$ curl -H "Espo-Authorization: AuthToken" "http://espocloud-ip: port/api/v1/Lead/id"
Note: there is no space between : port in the links. The : and p gets translated as emoji. So I have added spaceLast edited by theBuzzyCoder; 02-19-2018, 06:31 AM.
Comment
Comment