0

I bought a plugin for Redmine, called Helpdesk Plugin (http://redminecrm.com/projects/helpdesk/pages/1) which obviously is a ticketing system.

Is there anyway of connecting this specific plugin to a external website to extract ID's from the people that use the remote website and as they are uploading their ticket/issue we would know who that person was from a special ID. Maybe through a XML API? Or a Feed?

user1251007
  • 15,891
  • 14
  • 50
  • 76
  • You've answered your own question. Create an API for your external site and add code to your redmine installation to get the data from the external webapp – Loopo Sep 12 '14 at 13:16
  • Thanks for the answer. But how do I do that? That's what I'm scratching my head at, at the moment. – André Freitas Sep 16 '14 at 10:16

1 Answers1

0

How to create the API depends on your set-up. Generally you would have one application (redmine plugin) get some data (probably json/xml encoded) from another application (external website) by going to a particular URL.

so your client (redmine) would do a web request something like: (pseudocode)

response = curl_get('https://my.external-app.com/api/ticket?id='+ticketID)
external_people = json_decode(response)

This is basically making a web-request to some url and de-serialising the response so that you have data-structure (array or object) that you can easily use in your code.

Your external webapp would need to respond with the correct data, the easiest might be to place a script at /api/ticket that fetches the required data from your database and prints it out in some serialised format (xml/json):

ticket_id = http_request_parameter('id') 
// should do some validation here to prevent SQL-injection
...
// get the ticket details matching the id
sql_result = db_query_result("SELECT user_id from `issues` where id=" + ticket_id)
//send the result
print json_encode(sql_result)

Once you have this working you may want to add API-keys so that only authorised applications can retrieve the data.

Loopo
  • 2,204
  • 2
  • 28
  • 45