What is the limit on how many tags can be uploaded via the API?

Encountering issues uploading Multi-line tags via the API using the following: (login information redacted). Using C#
requestJobDescription={"type": "update", "credentials": {"partnerUserID": "XXXXXXXXXXX@XXXXXXX","partnerUserSecret": "XXXXXXXXXXXXX"}, "inputSettings": { "type": "policy","policyID": "9A1BA71006E444F4"},"tags": {"action": "replace", "source":"file", "config": {"dependency":true, "glCodes":true, "header":true, "setRequired":true, "fileType":"csv" }} }
Issue 1: If CSV file is > 500 lines, the command failes due to "File Size too large". However, when < 500 lines, work well
Issue2: The when action = MERGE, it still over-writes the existing data, not what is described in the documentation. The expected behavior is that it would add the data/tags to the existing ones.
Of note, the normal import process using the .csv file (1485 lines) works well
Here is the C# code being used:
public async Task updatePolicyTags()
{ Status("Sending TAGS Information");
using (var httpClient = new HttpClient()) {
clearScreen();
using (var request = new HttpRequestMessage(new HttpMethod("POST"), "https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations"))
{ var contentList = new List<string>();
string fileName = "c:\\ExpensifyIntegration\\SandBoxTest.csv";
string requestString = "requestJobDescription={\n\"type\": \"update\",\n\"credentials\": {\n\"partnerUserID\": \"" + GLOBAL.EIpartnerUserID + "\",\n\"partnerUserSecret\": \"" + GLOBAL.EIpartnerUserSecret + "\"\n},\n\"inputSettings\": {\n\"type\": \"policy\",\n\"policyID\": \"9A1BA71006E444F4\"\n},\n\"tags\": {\n\"action\": \"merge\",\n\"source\":\"file\",\n\"config\": {\n\"dependency\":true,\n\"glCodes\":true,\n\"header\":true,\n\"setRequired\":true,\n\"fileType\":\"csv\"\n}}\n}";
txtInput.Text = requestString; txtInput.Refresh();
string alism = null;
try
{
contentList.Add(requestString);
alism = File.ReadAllText(fileName);
contentList.Add(alism);
contentList.Add($"file={Uri.EscapeDataString(alism)}");
request.Content = new StringContent(string.Join("&", contentList));
request.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/x-www-form-urlencoded");
var response = await httpClient.SendAsync(request);
txtResponse.Text = response.ToString(); txtResponse.Refresh();
}
catch (Exception ex)
{
debugOutput("We had a problem: " + ex.Message.ToString());
}
}
}
}
Please advise. Datafile is attached.
Answers
-
@AOndrusek Multi-level tags gets a bit more complicated, but you should be able to import up to 5 levels, all levels combined should be 50k or less items.
-
Stevie,
Thanx for your response...However, I have far less than 50K items, more like 1493 items. It fails at 500. It is like there is a limit set on the API server that limits # entries. Also, the merge function does not work as described. The expected behavior is that it will ADD or MERGE new data to existing tags if it is not a repeat of any existing. However, it works just like the update and purges out all existing tags and replaces it with the new ones, and again limited to 500 entries.
-
Rachael Hopkins Expensify Success Coach - Admin, Expensify Team, Expensify Student Ambassador Posts: 904 Expensify Team
Hi @AOndrusek can you tell me how long the tags are? i.e. in characters? This could potentially be affecting things. I believe they need to be under 25 characters.