Publish from the company's website without exposing the key
The site form sends data to a script on your server, which calls GoCargo; the API key never reaches the browser.
- All companies
- 4 Steps
- Before starting
API key (Pro, Business, or Enterprise plan).
On this page (4 Steps)
- 1
Read the example
Pe pagina Dezvoltatori, secțiunea Site HTML simplu are un formular HTML și un script PHP de exemplu.
- 2
Keep the key on the server
Formularul trimite la scriptul dvs., iar scriptul cheamă GoCargo cu cheia setată în configurarea serverului (GOCARGO_API_KEY), nu în fișier.
Attention·Nu puneți niciodată cheia API în HTML sau în JavaScript din browser: oricine deschide pagina o vede și poate publica în numele firmei.
- 3
Secure the script
Permiteți doar utilizatori autentificați în site-ul dvs. și folosiți token CSRF.
- 4
Limit the key
Ideal, folosiți o cheie doar cu loads:write și restricție pe IP-ul serverului.
Related guides
The GoCargoAI consultant responds immediately; support team, via messages.