- Created by Administrator, last modified on Nov 13, 2024
Documentation's navigation
This page acts as a collection of all available Linchpin APIs.
Disclaimer
Please be aware that all APIs might be subject to change without prior announcement.
There is no guarantee and no support.
Use them at your own risk.
Linchpin Events
REST APIs
The Linchpin Events app has a RESTful API to retrieve useful information for any kind of external usage.
All endpoints return their data as JSON strings (a standardized lightweight data-interchange format).
Disclaimer
Please be aware, that all APIs might be subject to change without prior announcement.
There is no guarantee and no support.
Usage at your own risk.
Linchpin User Profiles
REST APIs
Linchpin User Profiles has a RESTful API to retrieve useful information for any kind of external usage.
All endpoints return their data as JSON strings (a standardized lightweight data-interchange format).
Disclaimer
Please be aware, that all APIs might be subject to change without prior announcement.
There is no guarantee and no support.
Usage at your own risk.
Profile Fields API
The Profile Fields API gives you all informations about the configured fields. The Profile Fields API is available under YOUR_DOMAIN_AND_CONTEXT/rest/cup/1.0/fields.
Retrieve a list of all configured user profile fields.
URL: /rest/cup/1.0/fields
Method: GET
Parameters: dataSource=[IDP|XML|LDAP|USER] (optional, filters list of fields by data source)
NEW IN LUP 2.21
Results in a complete list of configured fields including all configuration data:
[ { "confluenceCUPField": true, "dataSourceUrl": "string", "dataSourceType": "USER", "fieldCategoryPK": 0, "fieldType": "CASCADE", "helpTextKey": "string", "hidden": true, "inVCard": true, "instantMessagingOptionsDto": { "discoveryHost": "string", "host": "string", "label": "string", "localizedLabel": "string", "statusEnabled": true, "type": "JABBER" }, "labelPropertyKey": "string", "ldapField": true, "ldapKey": "string", "linkField": true, "linkOptionsDto": { "label": "string", "linkEnabled": true, "localizedLabel": "string", "url": "string" }, "localizedFieldCategoryLabel": "string", "localizedHelpText": "string", "localizedLabel": "string", "options": [ { "fieldOptionPK": 0, "labelKey": "string", "localizedLabelKey": "string", "optionPosition": 0 } ], "originFieldKey": "string", "position": 0, "referenceFieldBK": "string", "referenceMappings": [ { "dependentFieldBk": "string", "pK": 0, "sourceFilter": "string", "targetValue": "string" } ], "renderStrategy": {}, "required": true, "subtitle": true, "type": "CASCADE", "userFieldBK": "string", "userFieldPK": 0, "writeToLdapEnabled": true, "xmlField": true, "xmlKey": "string" }, { ... } ]
User Profile API
The User Profile API provides various profile information. The API is available under DOMAIN_AND_CONTEXT/rest/cup/1.0/profile.
Get the LUP profile of the current user
With this endpoint of the User Profile API you can get the complete profile data of the currently logged in user.
URL: DOMAIN_AND_CONTEXT/rest/cup/1.0/profile
Method: GET
Results in a complete set of profile information:
{ "cup.abteilungsnummer-13":"712", "cup.e-mail-10":"Buckminster.Powell@Sales.company.com", "cup.fachbereich-12":"Accounting", "cup.fachbereich-5":"Sales", "cup.jourfix-18":null, "cup.land-7":"Germany", "cup.ort-6":"Kassel", "cup.raumnummer-14":"5925", "cup.sprache-15":"DE", "cup.stufe-17":"Staff", "cup.telefon-11":"(003) 28547554", "cup.titel-16":"0", "cup.vorgesetzter-19":null, "cup.vorname-8":"Buckminster Powell" }
Get the LUP profile of a given user
With this endpoint of the User Profile API you can get the complete profile data of any given user.
URL: DOMAIN_AND_CONTEXT/rest/cup/1.0/profile/{userName}
Parameters:
userName: confluence user name for the profile you want to retrieve
Method: GET
Results in a complete set of visible profile information of a specified user:
{ "cup.abteilungsnummer-13":"580", "cup.e-mail-10":"Bianca.Villarreal@Executive.company.com", "cup.fachbereich-12":"Advertising", "cup.fachbereich-5":"Executive", "cup.jourfix-18":null, "cup.land-7":"Norway", "cup.ort-6":"Oslo", "cup.raumnummer-14":"2843", "cup.sprache-15":"EN", "cup.stufe-17":"Executive", "cup.telefon-11":"(08122) 5570356", "cup.titel-16":"0", "cup.vorgesetzter-19":null, "cup.vorname-8":"Bianca Villarreal" }
Write data for a given user
NEW IN 2.22.0
With this endpoint you can write the complete profile data.
We are very happy to hear from you if you plan to use this API. Feedback gives us the chance to learn about your use cases and to improve our solution. So if you like just drop us a note via our helpdesk.
URL: DOMAIN_AND_CONTEXT/rest/cup/1.0/profile/{userName}
Method: PUT
Data / body payload:
DOMAIN_AND_CONTEXT/rest/cup/1.0/profile/user{ "cup.abteilungsnummer-13":"580", // set a new single value "cup.fachbereich-12":["Advertising","Marketing","Front Office"], // set multiple values e.g. for multi select fields "cup.fachbereich-5":"", // delete a value with "" or null "cup.land-7":"Norway" }
Possible Responses:200 OK
403 FORBIDDEN (update not allowed for one of different reasons)
400 BAD REQUEST(if validation failed), result may look like this:
400 BAD REQUEST validation failed{ "general": ["You are not allowed to edit this profile." or other general messages] "fields": { "cup.field-2": "This field can only store exactly one value.", "cup.field-3": "The following select options are invalid: A, B, C.", "cup.field-4": "Field does not exist.", "cup.field-6": "Field is not writeable.", "cup.field-7": "Field is required." } }
Profile data API FAQ
Q: Can we update all field types using the API?
A: Yes.
Q: Can I have an example on how to update data for the type Cascade select?
A: Sure. Let's say your CSV file looks like the one we used as example in our documentation.
Cat-Number, Category, Group-Number, Group, Product-Id, Product 1, foodstuffs, 1, vegetables, aa, tomato 1, foodstuffs, 1, vegetables, ab, potato 1, foodstuffs, 2, fruits, ac, cherry 1, foodstuffs, 2, fruits, ad, apple 1, foodstuffs, 2, fruits, ae, banana 2, tools, 3, hand, ba, hammer 2, tools, 3, hand, bb, nipper 2, tools, 4, electric, bc, drilling machine
If you want to set "foodstuff - vegetables - tomato" and "tools - hand - nipper" to a users profile your JSON request should look like this (the field key must of course match the one you want to change in your system):
{ "cup.cascading-1":["1/1/aa","2/3/bb"] }
Warning: The API will actually not return an error if the data does not exist in your CSV file. It will be saved successfully but in the profiles UI will be no visible data.
Q: Can the user still overwrite the field after it has been updated by the API or is the field locked?
A: Updating profile fields via the profile API is only possible for fields that are writable, i.e. ones that are not obtaining their values through XML or LDAP import. Thus, it's always possible for users to edit the field values after the API has been used to set a field value. Programmatic locking/unlocking of fields for manual edits is not possible yet
Q: Is it possible to setup permissions in a way where only an API user can edit fields but users themselves don't have edit access, or maybe just restrict certain fields?
A: No, this is not possible yet. You can grant profile edit permissions to more users but can't exclude the owning user.
Q: Does the API wipe away other fields you don't specify in the API payload?
A: The API only updates the fields that are included with the update request, and keeps the rest intact. Deletion / wiping of existing field data is still possible by providing an empty string as update value, so if that's not desired, you'll need to make sure the JSON passed to our API only contains keys for those fields you'd like to update (and the corresponding values shouldn't be empty in that case, of course).
Profile Picture API
The User Picture API provides access to a users profile picture. The API is available under DOMAIN_AND_CONTEXT/rest/cup/1.0/profile.
Get the profile picture of the current user
With this endpoint of the User Profile API you can get the complete profile data of the currently logged in user.
URL: DOMAIN_AND_CONTEXT/rest/cup/1.0
/profile/
{username}
/profilepicture
Method: GET
Possible Responses: 200 OK
{ "uploadAllowed": true, "maxFileSize": 2048, "dimension": 200, "url": [string] }
Save a new profile picture to a given user
URL: DOMAIN_AND_CONTEXT/rest/cup/1.0/profile/{userName}/profilepicture
Body payload:
"imageDataUrl"
: [string] (data url of base64 encoded image, e.g. ""data:image/jpeg;base64,/9j/4AAQSk...")
Method: PUT
Possible Responses:
200 OK
403 FORBIDDEN (upload not allowed)
404 NOT_FOUND (no user or missing image data)
413 TOO_LARGE (image exceeds max file size)
415 UNSUPPORTED_MEDIA_TYPE (mime type is neither image/png nor image/jpg)
Profile Background Picture API
The User Background Picture API provides access to a users profile background picture. The API is available under DOMAIN_AND_CONTEXT/rest/cup/1.0/profile.
Get the profile background picture of the current user
With this endpoint of the User Profile API you can get the complete profile data of the currently logged in user.
URL: DOMAIN_AND_CONTEXT/rest/cup/1.0
/profile/
{username}
/background/image
Method: GET
Possible Responses: 200 OK + Image data
Save a new profile background picture to a given user
URL: DOMAIN_AND_CONTEXT/rest/cup/1.0/profile/{userName}/background/image
Method: PUT
Possible Responses:
200 OK
403 FORBIDDEN (upload not allowed)
404 NOT_FOUND (no user or missing image data)
413 TOO_LARGE (image exceeds max file size)
415 UNSUPPORTED_MEDIA_TYPE (mime type is neither image/png nor image/jpg)
Payload:
body: { "imageDataUrl": [string] (base64 encoded image data), "settings": { "position": { "x": [int], "y": [int] }, "imageVersion": [int] } }
Delete the profile background picture for a given user
URL: DOMAIN_AND_CONTEXT/rest/cup/1.0/profile/{userName}/background/image
Method: DELETE
Possible Responses:
200 OK
400 BAD_REQUEST
403 FORBIDDEN
404 NOT_FOUND
Linchpin Theme - Sidebar
Setup (Backend)
To connect a sidebar panel you need to use Atlassian's ModuleDescriptor mechanism.
An corresponding entry in the atlassian-plugin.xml looks like this:
<linchpin-sidebar-panel key="saved-for-later" class="net.seibertmedia.confluence.linchpinsidebar.panels.savedforlater.SavedForLaterPanel" />
key: a unique key for the descriptor within the implementing app
class: a class that implements the interface LinchpinSidebarPanel and thus further configures the panel (see JavaDocs of the interface).
Obsolete attributes since version 1.3 of the Linchpin Sidebar app
section-name: the section within which the panel is supposed to appear. Available sections: "linchpin", "confluence-features", "jira"
weight: Weight of the panel, determining the order of the panels within the section.
Since version 1.3 of the Linchpin Sidebar app (which comes bundled with new versions of Linchpin Theme, Suite and Essentials) segmenting and ordering items in the sidebar is configurable.
- Panels that have neither weight nor section will be placed at the end initially, until an admin changes this configuration.
- Pre-existing panels that have section and weight will be sorted by section and weight until the configuration is saved for the first time.
- New panels with section and weight that are added might appear in a random place, but once the configuration is saved, they keep their configured place.
Necessary Java classes are being exported by the app. The implementing app needs appropriate imports (pom.xml):
<dependency> <groupId>net.seibertmedia.confluence</groupId> <artifactId>linchpin-sidebar</artifactId> <version>1.2.3</version> <scope>provided</scope> </dependency>
You need to download and install this dependency to your local Maven repository: linchpin-sidebar-1.2.3.obr (This version should be sufficient for development, but you can also use linchpin-sidebar-1.3.0.obr)
mvn install:install-file -Dfile=./linchpin-sidebar-1.2.3.obr -DgroupId=net.seibertmedia.confluence -DartifactId=linchpin-sidebar -Dversion=1.2.3 -Dpackaging=obr -DgeneratePom=true
(see also http://maven.apache.org/general.html#importing-jars)
Necessary instructions for the maven-confluence-plugin in your pom.xml:
<DynamicImport-Package> net.seibertmedia.confluence.linchpinsidebar.connect.external, net.seibertmedia.confluence.linchpinsidebar.render.translate.external </DynamicImport-Package>
Setup (Content)
Currently the API only offers one method of integrating new sidebar content (see DisplayStrategy). While implementing the panel, a link to an action is transferred via the interface LinchpinSidebarPanel. The content of the panel is an iframe that renders this action.
Definition of an action in the atlassian-plugin.xml:
<xwork name="Linchpin Sidebar Actions" key="linchpin-sidebar-actions"> <package name="linchpin-sidebar-actions" extends="default" namespace="/linchpin/sidebar"> <default-interceptor-ref name="defaultStack"/> <action name="saved-for-later" class="net.seibertmedia.confluence.linchpinsidebar.panels.savedforlater.SavedForLaterAction" method="doDefault"> <result name="success" type="velocity">/sidebar/saved-for-later.vm</result> </action> </package> </xwork>
Definition of a sidebar icons resource in the atlassian-plugin.xml:
<web-resource key="linchpin-sidebar-panel-icons"> <resource name="recent.svg" type="download" location="sidebar/recent.svg" /> <resource name="new-star.svg" type="download" location="sidebar/new-star.svg" /> </web-resource>
Minimum content of a velocity-template in the resource folder:
#requireResourcesForContext("linchpin-sidebar-iframe-utils") <html> <head> <title>Sidebar iFrame</title> <meta name="decorator" content="atl.popup" /> </head> <body> <div> <p>Some content...</p> </div> </body> </html>
Stylings depending on a space scheme can be made with this lines within the iframe:
#set ($spaceKey = $req.getParameter("spaceKey")) #set( $ltpCtx = {"spaceKey" : "$spaceKey"}) #if($spaceKey && $linchpinTheme) $linchpinTheme.includeExtensionResources($ltpCtx) #end #* alternativ *# #parse ("/sidebar/space-scheme-aware-iframe.util.vm")
Integrating the resources under the context "linchpin-sidebar-iframe-utils" is necessary if:
- the content of the action varies in size and might become larger than the sidebar itself. The loaded JavaScript ensures that the iframe of the action will be responsive within the sidebar.
- it's necessary to use one of the following util methods.
Within the action you can import two methods via requireJS (or almond), that make communication with the window outside the iframe easier.
- getParentBody() returns a jQuery object of the surrounding body.
- executeInParent(fn) executes a function in the surrounding window.
With this it's possible for example to open an aui dialog outside of the action.
Example:
AJS.toInit(function () { var iframeUtils = require("linchpin/sidebar/iframe-utils"); // move dialog to parent iframeUtils.getParentBody().append($('#demo-dialog')); $('#demo-dialog').remove(); // Shows the dialog button within frame is clicked AJS.$("#dialog-show-button").click(function (e) { e.preventDefault(); iframeUtils.executeInParent(function () { AJS.dialog2("#demo-dialog").show(); }); }); // register close handler in parent iframeUtils.executeInParent(function () { // Hides the dialog AJS.$("#dialog-submit-button").click(function (e) { e.preventDefault(); AJS.dialog2("#demo-dialog").hide(); }); }); })
By implementing the LinchpinSidebarPanel you define the URL to the action, how menu entries and their icons are shown etc.
Example:
public class SavedForLaterPanel implements LinchpinSidebarPanel { private final static I18nKey headline = I18nKey.of("starred.title"); private final static I18nKey link = I18nKey.of("some.i18n.key"); /* wird später u.U. für Migrationspfade nötig. aktuelle Version: 1 */ @Override public int getApiVersion() {return 1; } /* aktuell einzige Art und Weise der Darstellung */ @Override public DisplayStrategy getDisplayStrategy() { return DisplayStrategy.ACTION; } /* Angabe, wo das Icon des Eintrags zu sehen ist (überall oder nur im ausgeklappten Modus der Sidebar, vgl. JavaDocs am Enum) */ @Override public MenuViewStrategy getMenuViewStrategy() { return MenuViewStrategy.DEFAULT; } /* Link zur Action */ @Override public String getActionUrl() { return "/linchpin/sidebar/saved-for-later.action"; } /* Identifier für das SVG-Icon (Format ist wichtig!) des Menüeintrages */ @Override public FrontendResourceIdentifier getIcon() { return new FrontendResourceIdentifier("net.seibertmedia.confluence.linchpin-sidebar:linchpin-sidebar-panel-icons", "new-star.svg"); } /* Identifier für das svg (Format ist wichtig!) Icon des Menüeintrages im ausgeklappten Zustand. Falls null wird das obere Icon verwendet. */ @Nullable @Override public FrontendResourceIdentifier getNavigationIcon() { return null; } /* i18n Objekt für die Headline. Nicht im getter erzeugen. Objekt wird zur Laufzeit übersetzt. */ @Override public I18nKey getHeadline() { return headline; } /* Link, der neben der Headline angezeigt wird. Optional. */ @Override public AnchorLink getAnchor() { return new AnchorLink(link, "http://google.com"); } }
Linchpin Microblog
Linchpin Launchpad
REST API
The Linchpin Launchpad app has a RESTful API to retrieve useful information for any kind of external usage.
All endpoints return their data as JSON strings (a standardized lightweight data-interchange format).
Please be aware, that all APIs might be subject to change without prior announcement.
There is no guarantee and no support.
Usage at your own risk.
Space Privacy
Disclaimer: Space Privacy is not included with the Linchpin Intranet Suite and must be bought separately from the Atlassian Marketplace.
Prefix
The Space Privacy API prefix is /rest/extranet/1.0/
for all endpoints listed below.
REST API
Space Privacy has a RESTful API to retrieve useful information for any kind of external usage.
All endpoints return their data as JSON strings (a standardized lightweight data-interchange format).
Please be aware, that all APIs might be subject to change without prior announcement.
There is no guarantee and no support.
Usage at your own risk.
☁️ Looking for a Cloud-based Intranet?
Check out Mantra, your go-to alternative to Linchpin in the Atlassian Cloud!
Mantra is your a comprehensive solution for connecting teams, making collaboration a breeze, and keeping your company's internal communication strong and streamlined - all in the cloud.
Test the intranet for Confluence Cloud now for free:
Link to this page: https://seibert.biz/linchpin-apis