Overview
To create a LiveConnect Journey with API make sure that you have the certificate downloaded and allowed on your device. See LiveConnect: Certificate and Proxy Setup for setup and configuration. See also LiveConnect: Create a New Journey for a refresher on creating Journeys in LiveConnect.
This article outlines the API process as done in Postman or through the terminal using cURL.
Authentication
First, to correctly authenticate, follow the instructions here.
Make a GET
call to https://api.observepoint.com/v2/manual-journeys
to return a list of all the devices for your account, and more importantly to obtain the ID of the device.
The JSON Response with displaying the device ID.
Note: You can Find ObservePoint's API documentation on https://api.observepoint.com/swagger-ui/index.html
Now that we have the ID, set the call to POST for https://api.observepoint.com/v2/manual-journeys/{manualJourneyId}
, and use the ID returned from the GET
call and replace {manualJourneyId}
with it.
Authentication and Content-type headers.
Be sure to add your api_key
or bearer_token
for authorization under headers and set the content-type to application/json
.
Click send with the call set to POST
, and if done correctly a proxy IP address, proxy port, and run Id will display below.
The JSON response displaying the proxy IP address and proxy port.
Enter the proxy info into the device you are using.
curl -X POST \
https://api.observepoint.com/v2/manual-journeys/920 \
-H 'Accept: */*' \
-H 'Authorization: api_key {your api key}' \
-H 'Cache-Control: no-cache' \
-H 'Connection: keep-alive' \
-H 'Content-Type: application/json' \
-H 'Host: api.observepoint.com' \
-H 'accept-encoding: gzip, deflate' \
-H 'cache-control: no-cache'
Take the Proxy information and enter it into the device that you will run LiveConnect on.
Append the runId
onto the URL with the following: /runs/{runId}/control
.
Obtain the Run ID from the last call you made.
The entire URL should look something like this: https://api.observepoint.com/v2/manual-journeys/920/runs/{runId}/control
.
To get the Proxy to connect, put the following in the Body text and click send:
{ "request": "start" }
When it starts, you will see a response like the following where Step 1 is returned as the name.
JSON response displaying successful action creation.
After you have successfully started your Journey, go to an app or webpage on your device and perform the Journey you wish to run.
curl -X POST \
https://api.observepoint.com/v2/manual-journeys/920/runs/4274/control \
-H 'Accept: */*' \
-H 'Authorization: api_key {your api key}' \
-H 'Cache-Control: no-cache' \
-H 'Connection: keep-alive' \
-H 'Content-Type: application/json' \
-H 'Host: api.observepoint.com' \
-H 'accept-encoding: gzip, deflate' \
-H 'cache-control: no-cache' \
-H 'content-length: 23' \
-d '{"request": "start"}'
After the "start" request has been sent, if you want to add a new step to the Journey make a POST
call to https://api.observepoint.com/v2/manual-journeys/1076/runs/{runId}/actions
The difference is that the URL for adding a new step is /actions
instead of /control
.
For all other actions make a POST
call to https://api.observepoint.com/v2/manual-journeys/920/runs/{runId}/control
.
With the request, add the following in the raw body code:
stop: Pauses the Journey run.
finalize: Saves the Journey run. This can only be sent after a "stop" request has been sent.
resume: Continues the Journey run after "stop".
restart: Restarts the Journey run after "stop".
Example of a "stop" action.
Save your Journey by sending a "finalize" request. Empty brackets indicate a successful save.
Successful stop and finalize steps will return empty brackets.
Go into the ObservePoint application and refresh your browser a couple of times to view the Journey you just created via the API.
curl -X POST \
https://api.observepoint.com/v2/manual-journeys/920/runs/4274/control \
-H 'Accept: */*' \
-H 'Authorization: api_key {your api key}' \
-H 'Cache-Control: no-cache' \
-H 'Connection: keep-alive' \
-H 'Content-Type: application/json' \
-H 'Host: api.observepoint.com' \
-H 'accept-encoding: gzip, deflate' \
-H 'cache-control: no-cache' \
-H 'content-length: 23' \
-d '{"request": "put action here"}