# Developing custom APIs through the plugin framework

**URL:** <https://developer.sailpoint.com/discuss/t/developing-custom-apis-through-the-plugin-framework/37642>\
**Category:** Video Library\
**Tags:** developer-days-2024-iiq, identityiq, developer-days\
**Created:** [March 25, 2024, 4:03pm UTC](https://developer.sailpoint.com/discuss/t/developing-custom-apis-through-the-plugin-framework/37642 "2024-03-25T16:03:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![adam\_creaney](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/adam_creaney/32/8971_2.png) [@adam\_creaney](https://developer.sailpoint.com/discuss/u/adam_creaney)\
**Post date:** [March 25, 2024, 4:03pm UTC](https://developer.sailpoint.com/discuss/t/developing-custom-apis-through-the-plugin-framework/37642/1 "2024-03-25T16:03:12Z")

</div>

[![](https://global.discourse-cdn.com/sailpoint/original/2X/c/cec2c87d507885f58453de39fce888cc632f1919.jpeg "Developing custom APIs through the plugin framework") ](https://www.youtube.com/watch?v=t0QoodWSb_U)

# Description

Adam Creaney, Director of Technology Alliances, walks us through the IdentityIQ Plugin Framework and how to develop your own, custom APIs.

---

<div class="post-metadata">

**Author:** ![iescobar76att](https://avatars.discourse-cdn.com/v4/letter/i/e95f7d/32.png) [@iescobar76att](https://developer.sailpoint.com/discuss/u/iescobar76att)\
**Post date:** [June 11, 2024, 3:58pm UTC](https://developer.sailpoint.com/discuss/t/developing-custom-apis-through-the-plugin-framework/37642/2 "2024-06-11T15:58:05Z")

</div>

Hi. Where can I find the source code for the sample plugin created in this session? -Thanks

---

<div class="post-metadata">

**Author:** ![adam\_creaney](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/adam_creaney/32/8971_2.png) [@adam\_creaney](https://developer.sailpoint.com/discuss/u/adam_creaney)\
**Post date:** [July 15, 2024, 5:52pm UTC](https://developer.sailpoint.com/discuss/t/developing-custom-apis-through-the-plugin-framework/37642/3 "2024-07-15T17:52:30Z")

</div>

We have a good example plugin for reference located here: [https://community.sailpoint.com/t5/Plugin-Framework/TodoPlugin-V3-zip/ta-p/79764](https://community.sailpoint.com/t5/Plugin-Framework/TodoPlugin-V3-zip/ta-p/79764)

But also, below is the simple example REST class used:

```auto
package com.sailpoint.plugin.exampleplugin.rest;

import java.sql.SQLException;
import java.text.ParseException;
import java.util.Map;
import java.util.Iterator;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import sailpoint.object.*;
import sailpoint.api.*;
import sailpoint.rest.plugin.BasePluginResource;
import sailpoint.rest.plugin.RequiredRight;
import sailpoint.tools.GeneralException;
import sailpoint.tools.Util;

/**
 * @author Adam Creaney
 * 
 * Class to manage all rest api calls.
 */
@Path("PluginExample")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@RequiredRight("examplePluginRight")
public class ExamplePluginRestManager extends BasePluginResource {
	
	private static final Log	log	= LogFactory.getLog(ExamplePluginRestManager.class);
	private Response response;
	
	public String getPluginName() {
		
		return "Example Plugin";
	}

	
	@GET
	@Path("example/{name}")
	public Response getExample(@PathParam("name") String name) throws GeneralException, SQLException {
		
		log.trace("Entering getExample...");
		SailPointContext context = SailPointFactory.getCurrentContext();
		int count = 0;
		try {
			QueryOptions qo = new QueryOptions();
			Iterator it = context.search(SyslogEvent.class, qo);
			while(it.hasNext()){
				SyslogEvent sle = (SyslogEvent) it.next();
			}
			String responseString = "UH OH";
			response = Response.status(Response.Status.OK).entity(responseString).build();
		} catch (GeneralException ge){
			response = Response.status(Response.Status.BAD_REQUEST).entity(ge.toString()).build();
		}

		log.trace("Exiting getExample...");

		return response;
	}
	
	@POST
	@Path("example")
	@RequiredRight("examplePluginRightWrite")
	public Response postExample(Map<String, Object> request) throws GeneralException, SQLException, ParseException {
		log.trace("Entering postExample...");
		Object country = "";
		Object job = "";

		try{
			country = request.get("country");
			job = request.get("job");
			if(country == null || job == null ){
				throw new GeneralException("Missing required value!");
			}

			response = Response.status(Response.Status.OK)
					.entity("The input country was: " + country + ", and the job was: " + job +"!").build();

		} catch (GeneralException e){
			response = Response.status(Response.Status.BAD_REQUEST)
					.entity(e.getMessage()).build();
		}

		log.trace("Exiting postExample...");
		
		return response;
	}

	/*
		SailPointContext context = SailPointFactory.getCurrentContext();

		QueryOptions qo = new QueryOptions();
		Iterator it = context.search(SyslogEvent.class, qo);
		while(it.hasNext()){
			SyslogEvent sle = (SyslogEvent) it.next();

		}
	*/
}

```

---

<div class="post-metadata">

**Author:** ![Giovanni\_23](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/giovanni_23/32/14280_2.png) [@Giovanni\_23](https://developer.sailpoint.com/discuss/u/Giovanni_23)\
**Post date:** [July 19, 2024, 3:14pm UTC](https://developer.sailpoint.com/discuss/t/developing-custom-apis-through-the-plugin-framework/37642/4 "2024-07-19T15:14:08Z")

</div>

Hi, I implemented a new plugin from the example plugin. The new plugin works correctly and REST calls are executed successfully.  
The infrastructure used is composed of four Taskservers that share a single database. However, REST calls are only successful if made on the server where the plugin was loaded, even though the plugin is visible from the other servers. Could there be some missing configuration or is there something I should do to solve this problem?

Thanks!

---

<div class="post-metadata">

**Author:** ![HemantSingh](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/hemantsingh/32/6737_2.png) [@HemantSingh](https://developer.sailpoint.com/discuss/u/HemantSingh)\
**Post date:** [July 19, 2024, 4:06pm UTC](https://developer.sailpoint.com/discuss/t/developing-custom-apis-through-the-plugin-framework/37642/5 "2024-07-19T16:06:19Z")

</div>

as plugins are loaded in database so it should work from all servers, you can try restarting the server and then test.

---

<div class="post-metadata">

**Author:** ![Giovanni\_23](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/giovanni_23/32/14280_2.png) [@Giovanni\_23](https://developer.sailpoint.com/discuss/u/Giovanni_23)\
**Post date:** [July 22, 2024, 3:19pm UTC](https://developer.sailpoint.com/discuss/t/developing-custom-apis-through-the-plugin-framework/37642/6 "2024-07-22T15:19:18Z")

</div>

Thanks, this worked for me.

---

<div class="post-metadata">

**Author:** ![vishal\_kejriwal1](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/vishal_kejriwal1/32/10904_2.png) [@vishal\_kejriwal1](https://developer.sailpoint.com/discuss/u/vishal_kejriwal1)\
**Post date:** [March 7, 2025, 6:52pm UTC](https://developer.sailpoint.com/discuss/t/developing-custom-apis-through-the-plugin-framework/37642/8 "2025-03-07T18:52:17Z")

</div>

I see sometimes that changes to plugin are reflect back until we restart the servers , anyway to solve this ?

---

<div class="post-metadata">

**Author:** ![kcnix](https://avatars.discourse-cdn.com/v4/letter/k/4bbf92/32.png) [@kcnix](https://developer.sailpoint.com/discuss/u/kcnix)\
**Post date:** [June 5, 2025, 11:58am UTC](https://developer.sailpoint.com/discuss/t/developing-custom-apis-through-the-plugin-framework/37642/9 "2025-06-05T11:58:16Z")

</div>

Can I get the source code for this example please.
