If you want to integrate with Elgg, have a look at it's web services API: http://docs.elgg.org/wiki/Web_Services
You can use existing plugins to implement part of the logic on the backend side: https://github.com/Tachyon/Elgg-Web-Services
For more detailed support, seek help at Elgg community discussion forums