The ProdSys API allows you to integrate and retrieve data from your ERP system efficiently. Follow this guide to get started with the ProdSys API.
1. Before You Start:
Before you begin using the API, ensure that you have access to the database you need to connect to and create and Token to use in the integration.
See how you can generate a token here
2. Authentication
The ProdSys API uses authentication to ensure that your requests are valid and that data is secure.
API Key: You will receive an API key when you gain access. This key is used to authenticate your requests.
Use the API Key: When sending an HTTP request, you need to include the API key in the Authorization header.
Example of authentication:
bash
Kopier
curl -X GET https://api.prodsys.no/endpoint \
-H "Authorization: Bearer <your_api_key>"
3. Connect to the API
Once authentication is in place, you can start sending requests to the ProdSys API.
Base URL: The API uses a base URL for all requests, for example:
https://api.prodsys.no/
Endpoints: Each API endpoint corresponds to a specific functionality in ProdSys, such as retrieving project information, creating invoices, or getting stock data.
4. List of all API function available in ProdSys
All API available are listed in a Swagger with index and explanations
https://app.prodsys.com/api/swagger/index.html
5. Making a GET Request
A common request is a GET request, which retrieves data from the system.
Example of a GET request to retrieve project information:
bash
Kopier
curl -X GET https://api.prodsys.no/projects/{id} \
-H "Authorization: Bearer <your_api_key>"
Response: The API will return data in JSON format, which you can use in your application.
6. Making a POST Request
To add data to ProdSys, you can make a POST request.
Example of creating a new invoice:
bash
Kopier
curl -X POST https://api.prodsys.no/invoices \
-H "Authorization: Bearer <your_api_key>" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "12345",
"amount": 1000,
"due_date": "2025-01-01"
}'
Data: Here, you send JSON data representing the invoice to be created.
7. Error Handling
When making requests, you may encounter errors. The ProdSys API will return error messages and status codes to help you diagnose the issue.
Common status codes:
200 OK: The request was successful.
400 Bad Request: The request is missing required data or contains an error.
401 Unauthorized: The API key is invalid or missing.
404 Not Found: The endpoint was not found.
Example of an error response:
json
Kopier
{
"error": "Invalid API key",
"status_code": 401
}
8. Using Filtering and Sorting
You can also use filtering and sorting to get more precise results from the API.
Example of filtering projects by date:
bash
Kopier
-H "Authorization: Bearer <your_api_key>"
8. Documentation
For details about each API endpoint and how to use them, refer to the ProdSys API documentation. This documentation provides an overview of available endpoints, parameters, and examples.
Documentation: ProdSys API Documentation
9. Using the API in Your Application
Once you are comfortable with the API requests, you can start integrating them into your own applications, whether it’s a website, mobile app, or another system that needs to communicate with ProdSys.
10. Troubleshooting and Support
If you run into issues or have questions, you can always contact ProdSys support for assistance with using the API.
Conclusion:
By using the ProdSys API, you can efficiently retrieve and send data to your ERP system, thus automating many processes and integrations with other systems. Follow the steps above to get started and take advantage of the powerful functionality the system provides.