var listId= "226468"; var hapiKey = "{YOUR_HAPI_KEY_HERE}";
var client = new RestClient("https://api.hubapi.com/"); var request = new RestRequest("contacts/v1/lists/{listId}/add", Method.POST); request.AddUrlSegment("listId", listId); request.AddQueryParameter("hapikey", hapiKey); request.RequestFormat = DataFormat.Json;
I create a list and it looks like the ID is 1 is this the correct number?
I'm getting an error:
{"status":"error","message":"Invalid input JSON on line 1, column 10: Can not deserialize instance of java.lang.Long out of START_OBJECT token","correlationId":"82172630-ed10-46db-b87f-bf2804838995","requestId":"33d218a88fd99fe221001b85507f1462"}
var listId = "1";
var hapikey = "{YOUR_HAPI_KEY_HERE}";
var client = new RestClient("https://api.hubapi.com/");
var request = new RestRequest("contacts/v1/lists/{listId}/add", Method.POST);
request.AddUrlSegment("listId", listId);
request.AddQueryParameter("hapikey", hapikey);
request.RequestFormat = DataFormat.Json;
request.AddJsonBody(new
{
vids = new[]{
new{property="vids",value="1301"}
}
});
IRestResponse response = client.Execute(request);
Debug.Write(response.Content);