Deleting UGC Records Using the API

Follow

By design, you will not be able to delete UGC records using the API using the standard UGC password. You need to use the Website UGC Admin API password to initialize the API and allow you to delete UGC records. Because this requires the Admin API password, its recommended to ONLY delete UGC records using the .NET sdk so you can protect against abuse.

If you do not have this information already, please contact support@agilitycms.com and it can be provided.

Once you have the key, you can initialize an admin connection using the following code snippet:

using (Agility_UGC_API_WCFClient client = UGCAPIUtil.APIClient)
{
     DataServiceAuthorization auth = UGCAPIUtil.GetDataServiceAuthorization("the same API key from your web.config goes here", "admin password goes here", -1);
     bool deleted = client.DeleteRecord(auth, ID); 
}
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.