Skip to main content
Question

Self Service URL Formats for Categories?

  • January 23, 2018
  • 8 replies
  • 54 views

Forum|alt.badge.img+4

Hello!

We're starting to use the new Self Service URL format for staff communication.
Policies take the following URL format:
jamfselfservice://content?entity=policy&id=792&action=view

Due to Google Mail's stripping of application-specific hyperlinks, we have to create a PHP redirect that identifies the requested entity, id and action, then constructs the Self Service query. This works great! Now we'd like to create URLs that open Self Service and point to Library categories instead of specific Policies; is anyone aware of the format these links would use? I'd assume it's something along the lines of:
jamfselfservice://content?entity=category&id=1

... but obviously it's not that, and I couldn't find any documentation referencing the possible entity names. Thank you!

8 replies

mallej
Forum|alt.badge.img+4
  • Contributor
  • January 30, 2018

Hi @cornwella ,

how are these PHP redirects created? We are in the same situation with Gmail and no working hyperlinks to policies.

thanks


Forum|alt.badge.img+4
  • Author
  • Contributor
  • January 30, 2018

Hi @jensm ,

below is the code we use. We called our file self.php. You can adjust it to your needs!

<?php

// Self Service Redirect

// This script takes URL parameters for Jamf's Self Service module
// and creates a redirect, in order to work around Google Mail's link
// stripping of app-specific URLs (e.g. non-HTTP/HTTPS/FTP links).

// Example:
// jamfselfservice://content?entity=policy&id=792&action=view
// ... can be linked as ...
// http://(your server)/self.php?entity=policy&id=792&action=view

if ((!isset($_GET['entity'])) || (!isset($_GET['id'])) || (!isset($_GET['action']))) {
        header("Location: jamfselfservice://content");
} else {
    $entity = stripslashes($_GET['entity']);
    $id = (int)$_GET['id'];
    $action = stripslashes($_GET['action']);

    // Add possible value options here to prevent generation of arbitrary links.
    // There may be more, but these are the only ones I've found so far.
    if (($entity == "policy") && (($action == "view") || ($action == "execute"))) {

        header("Location: jamfselfservice://content?entity=" . $entity . "&id=" . $id ."&action=". $action); 

    } else {

        echo "Invalid URL parameters.";
        echo "<p><b>entity:</b> policy<br> <b>action:</b> view, execute </p>";
    }

}
exit();
?>

mallej
Forum|alt.badge.img+4
  • Contributor
  • January 30, 2018

thanks @cornwella ,

where do i have to put self.php in?


Forum|alt.badge.img+4
  • Author
  • Contributor
  • January 30, 2018

You can host it on any PHP-enabled web server that is accessible to the recipients of your email.

If you don't already have one, here's a good guide on how to get started (you can skip MySQL, though it does come in handy).


mallej
Forum|alt.badge.img+4
  • Contributor
  • January 31, 2018

thanks @cornwella , now i get it.


Forum|alt.badge.img+14
  • Contributor
  • September 11, 2019

QCM
Forum|alt.badge.img
  • New Contributor
  • January 26, 2024

Hi @jensm ,

below is the code we use. We called our file self.php. You can adjust it to your needs!

<?php

// Self Service Redirect

// This script takes URL parameters for Jamf's Self Service module
// and creates a redirect, in order to work around Google Mail's link
// stripping of app-specific URLs (e.g. non-HTTP/HTTPS/FTP links).

// Example:
// jamfselfservice://content?entity=policy&id=792&action=view
// ... can be linked as ...
// http://(your server)/self.php?entity=policy&id=792&action=view

if ((!isset($_GET['entity'])) || (!isset($_GET['id'])) || (!isset($_GET['action']))) {
        header("Location: jamfselfservice://content");
} else {
    $entity = stripslashes($_GET['entity']);
    $id = (int)$_GET['id'];
    $action = stripslashes($_GET['action']);

    // Add possible value options here to prevent generation of arbitrary links.
    // There may be more, but these are the only ones I've found so far.
    if (($entity == "policy") && (($action == "view") || ($action == "execute"))) {

        header("Location: jamfselfservice://content?entity=" . $entity . "&id=" . $id ."&action=". $action); 

    } else {

        echo "Invalid URL parameters.";
        echo "<p><b>entity:</b> policy<br> <b>action:</b> view, execute </p>";
    }

}
exit();
?>

I see this is an older thread by was wondering if you made any improvements to this script especially now that Jamf has published Self Service URL Scheme documentation here:

https://learn.jamf.com/bundle/jamf-pro-documentation-current/page/Jamf_Self_Service_for_macOS_URL_Schemes.html

Particularly to add support for Search links, as well as Categories.


JevermannNG
Forum|alt.badge.img+8
  • Valued Contributor
  • June 6, 2025

I see this is an older thread by was wondering if you made any improvements to this script especially now that Jamf has published Self Service URL Scheme documentation here:

https://learn.jamf.com/bundle/jamf-pro-documentation-current/page/Jamf_Self_Service_for_macOS_URL_Schemes.html

Particularly to add support for Search links, as well as Categories.


Just wondering if it works for anyone like described in the Documentation?

When I use this syntax:

jamfselfservice://content?action=category&id=-1

The Result looks like this:
zsh: no matches found: jamfselfservice://content?action=category

Our Clients run on Jamf Pro 11.17.1