View Epicollect5 photos on external website

Hello, I am developing a web system which is related to the information that is saved in Epicollect5, in this case with the issue of images in our projects.

In that order of ideas, when the project is public, the images are obviously visible, but when the project is private, the images are not available.

According to the above, this is my code where I try to access the images $row[‘foto_firma’] is where I only save the path of the image, but they tell me that it is a private project.

while ($row = $statement->fetch_array()) {
$sub_array = array();
$sub_array[] = $row[“idacta_preventiva”];

$sub_array[] = "<img class='img-circle' src='https://five.epicollect.net/api/internal/media/preventiva-cart-947?type=photo&format=entry_original&name=" . $row["foto_firma"] . "' width='60' height='60' crossorigin='anonymous'>";


$codigo_acta = $row['idacta_preventiva'];
$codigo_persona = $row['p_codigo'];
$codigo_hash = $row['codigo_hash'];

$sub_array[] = "<center>
<a class='btn btn-success btn-block btn-sm' href='ver-acta-preventiva?codigo_hash=" . $codigo_hash . "' title='Ver Información Acta'>Ver Acta</a>
</center>";

$data[] = $sub_array;

}

In that case, give me an example of how I can access the information, I already tried using the API but it still generates an error, so I don’t know if I am doing it right or wrong, please give me an example of how it is done, what data I need to be able to remotely access the images of a private project.

It seems there might be an issue with the endpoint you’re trying to access. Specifically, the api/internal/ endpoint is not publicly exposed.

To proceed with accessing the correct endpoints in our system, we suggest following these steps:

  1. Retrieve Authentication Credentials: Begin by obtaining the authentication credentials required for integrating with our third-party system. You can acquire these credentials by following the instructions in the API Authentication - Create Client App page.

  2. Review Correct Endpoints: Please review the accurate endpoints available for your integration. These can be found in the documentation section related to Media - Get Media.

  3. Examples and Implementations: Explore the examples provided in our documentation, which offer practical illustrations of accessing the endpoints. You’ll find various examples demonstrating different languages, including PHP. Please visit Getting Media - Examples for detailed implementation samples.

  4. API rate limiting. Be aware of API rate limiting as explained at Epicollect5 API - Epicollect5 Data Collection API. This feature is in place to ensure optimal resource utilization and maintain system efficiency for all users.
    Our team is actively monitoring the system to prevent abuse of resources.
    It’s crucial for us to maintain a balanced and fair environment for all users leveraging our API services.

By following these steps, you’ll be well-equipped to access the appropriate endpoints using the correct authentication credentials.

1 Like

Thank you very much for your response, but for this specific case do you have an example to be able to carry out the process, or give me the answer in a little more detail. Thank you.

<?php
$img = "<img class='img-circle' src='https://five.epicollect.net/api/export/media/preventiva-cart-947?type=photo&format=entry_original&name=f33d6470-28d0-4ce4-bb0d-bfc0a059165f_1702239376.jpg' width='100'/>";

echo $img;

you can try it at W3Schools Tryit Editor

Ok, I understand your solution and it is very valuable to me, but the issue is that that is when it is a public project, if you want you can try again and you will notice that the image does not appear.

What I need is a complete PHP example on the use of the API, since I don’t understand very well how I should put all the files, although I developed the previous codes, I know little about the management of the APIs, in that order of ideas Please give me a code that shows the implementation of the API, thank you very much.

Have a look at our docs, there are a few examples