Initiate your app to run whenever you feel like it and add custom data to the request. Perhaps to start a scheduled job or if receiving web hooks or any kind of data changes from other systems.
How to run your app manually
Let us know you want your app to run by doing a POST to Upsales API /appHook endpoint
https://integration.upsales.com/api/external/appHook?customerId=&userId=&authenticationKey=&appId=
Replace customerId with the customerId you want the app to run for. If your app is user configurable, add the users userId.
Replace authenticationKey with your apps authentication key and appId with your apps id. Send any JSON data you like as the body for the request. This will be forwarded in our request to your app.
The app must be active for that customer. /appHook answers 200 with {"data":"ok"} to every request, including requests that are rejected: a wrong authenticationKey or appId, an app that is not active for the customer, a missing userId for a user configurable app, or a userId that does not belong to the customer. To confirm that your app ran, check that it received our request to /external.
What we will post to your app
When we receive your request to /appHook, we'll send a POST back to your app to /external. https://yourapp.com/external The requests body.data will contain the JSON body you sent to /appHook.
The request body to your /external contains all the config, appdata and metadata (like any other app request) complete with the body you sent to our /appHook