Need help with function that carrys tags over from contacts to deals

Need help with function that carrys tags over from contacts to deals

I think I have the actual code correct but I believe that I am having trouble regarding the setup of the connection.

The scopes I have for the connection are:

ZohoCRM.functions.execute.CREATE,
ZohoCRM.functions.execute.READ,
ZohoCRM.modules.ALL

The error I am getting is:

  • {"code":"INVALID_REQUEST","details":{},"message":"unable to process your request. please verify whether you have entered proper method name, parameter and parameter values.","status":"error"}

and here is my code for the function: 

contactInfo = zoho.crm.getRecordById("Contacts",contactId);
contactTag = ifnull(contactInfo.get("Tag"),"");
contactTagName = "";
if(contactTag.size() > 0)
{
for each  tag in contactTag
{
tagname = tag.get("name");
contactTagName = contactTagName + ",";
}
relDeal = zoho.crm.getRelatedRecords("Deals","Contacts",contactId,1);
if(relDeal.size() > 0)
{
for each  rec in relDeal
{
mp = Map();
mp.put("tag_names",contactTagName.removeLastOccurence(","));
response = invokeurl
[
        url :"https://www.zohoapis.com/crm/v2/Deals/" + rec.get("id") + "/actions/add_tags?"             type :POST
parameters:mp
connection:"tagconnector"
];
info response;
}
}
}