-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathintegrate.sh
executable file
·38 lines (29 loc) · 1.01 KB
/
integrate.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# Aenzbi Integration Script
echo "Starting Aenzbi integration setup..."
# Check if curl is installed
if ! [ -x "$(command -v curl)" ]; then
echo "curl is not installed. Installing curl..."
sudo apt-get install -y curl
else
echo "curl is already installed."
fi
# Set the endpoint URL
NEW_API_URL="https://ep-steep-hall-a4jlheao-pooler.us-east-1.aws.neon.tech"
# Function to integrate with the endpoint
integrate_with_endpoint() {
local data=$1
# Make the HTTP POST request to the endpoint
response=$(curl -s -w "%{http_code}" -o /dev/null -X POST "$NEW_API_URL/your-endpoint" -H "Content-Type: application/json" -d "$data")
# Check if the request was successful
if [ "$response" -eq 200 ]; then
echo "Integration with endpoint was successful."
else
echo "Failed to integrate with endpoint. HTTP status code: $response"
fi
}
# Example data to send
data='{"key": "value"}'
# Call the function to integrate with the endpoint
integrate_with_endpoint "$data"
echo "Integration setup complete."