Introduction
Welcome to Bonjour API. You can access our API to access endpoints, returning user pendency in DAN Network.
Installation
macOS
Only 64bit binaries are provided for macOS, and the minimum macOS version supported is macOS 10.9.
Pre-requisites:
- SSH must be enabled on MAC (for remote installations)
- The script must be run as root
- Only the common owner of the machine must be logged in the console, if another user as the administrator for example is also logged in the console the execution of the script will do the incorrect installation of Bonjour
- The user's HOME folder name must be the same as the login (Example: The isouza99 user HOME folder should be /Users/isouza99 and not /Users/isaias.souza)
- User must be a member of the domain
AUTOMATED VIA SCRIPT INSTALLATION PROCEDURE:
Logging via SSH
ssh administrator @IP_DO_MAC
Privilege escalation
sudo bash
Verifying if only the user owner of the machine is logged in the console
whoami
Downloading and Running the Installation Script
curl "http://brsap4apl02.americas.media.global.loc/files/install-bonjour.sh" | sh
For MACs that do not meet the prerequisites you will need to do the manual installation.
MANUAL INSTALLATION PROCEDURE (via terminal) [Use this procedure only if you can not do the procedure via script]:
Download and extract the Bonjour Package
cd /tmp
curl "http://brsap4apl02.americas.media.global.loc/files/bonjour-mac.zip" -o "bonjour.zip"
unzip bonjour.zip
cd bonjour
Copy Bonjour for User Applications
cp -R /tmp/bonjour/Bonjour_STABLE/Bonjour.app/Users/$USER_USER/Applications/
Change the Bonjour.app owner with the chown command so that the user has permission in the APP
chown -R isouza99 /Users/isouza99/Applications/Bonjour.app/
Copy the plist to the User Library
cp /tmp/bonjour/com.bonjour.plist /Users/$HOME_DO_USER/Library/LaunchAgents/
Edit the file /Users/$HOME_DO_USUARIO/Library/LaunchAgents/com.bonjour.plist changing the words USER to the name of $ HOME_DO_USER
Example:
From: <string> /Users/USUARIO/Applications/Bonjour.app/Contents/MacOS/Bonjour </ string>
<Key> StandardInPath </ key>
<String> /Users/USUARIO/Applications/Bonjour.app/Contents/MacOS/Bonjour </ string>
To: <string> /Users/isouza99/Applications/Bonjour.app/Contents/MacOS/Bonjour </ string>
<Key> StandardInPath </ key>
<String> /Users/isouza99/Applications/Bonjour.app/Contents/MacOS/Bonjour </ string>Kill all Bonjour processes (Execute the command twice)
killall "Bonjour"
Killall "Bonjour"
Remove Bonjour from Applications
rm -rf /Applications/Bonjour.app
Start Bonjour from the User Applications
open /Users/$HOME_USER_Applications/Bonjour.app
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<false/>
<key>Label</key>
<string>com.bonjour</string>
<key>Program</key>
<string>/Users/USUARIO/Applications/Bonjour.app/Contents/MacOS/Bonjour</string>
<key>StandardInPath</key>
<string>/Users/USUARIO/Applications/Bonjour.app/Contents/MacOS/Bonjour</string>
<key>StartInterval</key>
<integer>300</integer>
</dict>
</plist>You must replace
with your desired interval to prevent Bonjour to be closed and replace USUARIO with local user ( SSO ).300
After that copy plist file to /Users/{SSO}/Library/LaunchAgents, and restart computer.
Windows
Windows 7 and later are supported, older operating systems are not supported (and do not work).
Both ia32 (x86) and x64 (amd64) binaries are provided for Windows. Please note, the ARM version of Windows is not supported for now.
Pre-requisites:
Perform the procedure on the user profile of the machine owner.
Download the \10.81.135.14\bonjour\bonjour-windows folder Network Login: box Password: 123@mudar
Run the install-bonjour.bat script as Administrator
If the command prompt asks if you want to overwrite the files choose the option yes for all; When requesting the password of the user who owns the profile, simply press ENTER without typing anything that the system will accept, since you are already logged in with the user.
When the script is successfully executed, bonjour will automatically start in 5 minutes.
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2016-12-14T11:53:19.5044077</Date>
<Author>MBSINTL\USUARIO</Author>
<URI>\Timesheet-Task</URI>
</RegistrationInfo>
<Triggers>
<TimeTrigger>
<Repetition>
<Interval>PT5M</Interval>
<StopAtDurationEnd>false</StopAtDurationEnd>
</Repetition>
<StartBoundary>2016-12-14T11:52:22</StartBoundary>
<Enabled>true</Enabled>
</TimeTrigger>
</Triggers>
<Principals>
<Principal id="Author">
<UserId>S-1-5-21-2077120089-565403145-630672053-418120</UserId>
<LogonType>InteractiveToken</LogonType>
<RunLevel>LeastPrivilege</RunLevel>
</Principal>
</Principals>
<Settings>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
<AllowHardTerminate>true</AllowHardTerminate>
<StartWhenAvailable>false</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
<IdleSettings>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<AllowStartOnDemand>true</AllowStartOnDemand>
<Enabled>true</Enabled>
<Hidden>false</Hidden>
<RunOnlyIfIdle>false</RunOnlyIfIdle>
<WakeToRun>false</WakeToRun>
<ExecutionTimeLimit>PT72H</ExecutionTimeLimit>
<Priority>7</Priority>
</Settings>
<Actions Context="Author">
<Exec>
<Command>"C:\Program Files\Timesheet\Update.exe"</Command>
<Arguments>--processStart "Bonjour.exe"</Arguments>
</Exec>
</Actions>
</Task>API Endpoints
Pendency V1
Endpoint to Bonjour Versions lte 1.0.8
Search Pendency
{
"statusMessage": "Pendente",
"statusHash": "pendente",
"statusCode": 1,
"isPendente": 1,
}This endpoint return user status in Workfront
HTTP Requests
GET http://bonjour.lovit.com.br/api/v1/pendency/<sso>
URL Parameters
| Parameter | Description |
|---|---|
| sso | Active Directory Username ( AD ) |
Pendency V2
Endpoint to Bonjour Versions gte 1.0.9
Search Pendency
{
"notification": "Please regularize the hours worked in the last days, in your timesheet as soon as possible.",
"iconURL": "red.png",
"window": {
"type": "popup",
"headerURL": "http://bonjour-assets.lovit.com.br/htmls/two-days-pendency/header_blocked.html",
"headerHeight": "150",
"bodyURL": "http://bonjour-assets.lovit.com.br/htmls/two-days-pendency.html",
"blockStation": 0
}
}This endpoint return user status in Workfront
HTTP Requests
POST http://bonjour.lovit.com.br/api/v2/pendency/<sso>
URL Parameters
| Parameter | Description |
|---|---|
| sso | Active Directory Username ( AD ) |
Body Data
| Parameter | Description | Type | Example |
|---|---|---|---|
| service_url | Endpoint requested | url | http://bonjour.lovit.com.br/api/v2/pendency/ |
| version | Bonjour Client Version | string | 1.0.10 |
| nocache | Force nocache request | boolean | true |
| platform | OS ( Windows or macOS) | string | Windows |
| locale | Localization | string | ptBR |
| arch | Architecture | string | x64 |
| channel | Release channel ( stable, rc, beta etc.) | string | stable |
| screen_resolution | User resolution | array objects {width,height} | [{"width":1024,"height":672}] |
| globalPosLat | Latitude | number | -23.555277 |
| globalPosLong | Longitude | number | -46.690302 |
| exceptionRequest | Asking for block exception | boolean | true |
Downloads
Download here the last releases.
Stable
| OS | Link |
|---|---|
| Windows | http://bit.ly/2lgr5On |
| macOS | http://bit.ly/2lcqbGZ |
RC
| OS | Link |
|---|---|
| Windows | http://bit.ly/2kFKVpz |
| macOS | http://bit.ly/2kzTsbu |
Errors
Bonjours uses the following code errors:
| Error Code | Meaning |
|---|---|
| 400 | Bad Request -- Your request are wrong |
| 401 | Unauthorized -- Your API key is wrong |
| 404 | Not found -- The specified user could not be found |
| 500 | Internal Server Error -- We had a problem with our server. Try again later. |
| 503 | Service Unavailable -- We're temporarially offline for maintanance. Please try again later. |