Giter VIP home page Giter VIP logo

pipedrive-dotnet's People

Contributors

chinh-p avatar crwsolutions avatar czietsman avatar davidrouyer avatar dependabot-preview[bot] avatar dependabot[bot] avatar gregarican avatar halceyon avatar luckynos7evin avatar snappet-panksy avatar sprudhomme avatar woodylaurence avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pipedrive-dotnet's Issues

Updating a Deal without providing custom fields.

I had a method for just updating the Deal Status. I didn't need to modify anything else. Unless I built out a reference to any/all DealFields, the routine crashed due to these being null. So I added this to Line 196 in the CustomFieldsConverter.cs in your project to workaround this.

if (customFields != null)
            {
                foreach (var field in customFields)
                {
                    if (field.Value == null)
...

Exception in retrieving the Person fields

Hi David,

await pipedriveClient.PersonField.GetAll(); was working fine earlier. But today while I was trying to read the person fields of a new pipedrive sandbox, I see that it is throwing the below exception:

Could not convert string to DateTime: 0000-00-00 00:00:00. Path 'data[4].add_time', line 1, position 1950.

Really appreciate your help.

Product endpoints not supported

It appears the current implementation does not support the Product endpoints (and related Deal-Product endpoints).
We will be looking to create a pull request in the coming weeks to rectify this; will you be available to look at it? We would very much appreciate it!

Thanks,
Laurence

Question about API methods soon to be deprecated.

I have found this project very useful for some production integrations I've implemented since the beginning of 2020. Quick question. Checking the Pipedrive API site, I see mention of some API methods that will be eliminated March 31, 2021 (see below). Were any of these API methods present as of assembly file version 0.1.10.0 of this project?


Warning!
Published: 8 April 2020

On 31 March 2021 we will remove the following endpoints:

GET /deals/find
GET /organizations/find
GET /persons/find
GET /products/find
GET /searchResults
GET /searchResults/field
In case you are using the above-mentioned API endpoints in your code or 3rd party app/integration, please make sure to read the migration guide at https://pipedrive.readme.io/docs/new-search-api-migration-guide.

Reading a deal when the person is hidden

I found that if I try to read a deal when someone else has set the person_id to a person that is hidden from me, pipedrive only returns the person_id. This will cause the deserialize routine to fail because the format of the return JSON data does not match the structure of deal class. I don't know the best way to fix this but I was able to add an [onerror] property to the deal class so that I could get the data without generating an exception. I would appreciate a suggestion on the best way to address this issue.

Getting all webhooks fails if any webhook is in "Error" state

Problem description
Trying to use IWebhooksClient.GetAll() while there is a webhook in "Error" state throws the following exception:

Newtonsoft.Json.JsonReaderException: Could not convert string to integer: Error. Path 'data[0].last_http_status', ...

Webhook's LastHttpStatus is not always an integer value, as described here: https://pipedrive.readme.io/docs/guide-for-webhooks#section-status-codes-for-webhooks.

Steps to reproduce

  1. Create an endpoint for your new webhook which takes more than ten seconds to execute.
  2. Register a new webhook in Pipedrive using your webhook address.
  3. Trigger a request to your webhook and wait for the response.
  4. Inspect that the webhook is now in "Error" state ("last_http_status":"Error").
  5. Try to use webhooks client's GetAll() to get all the webhooks.

Expected behavior
All webhooks are returned.

Pipedrive crashed while getting deal!!!

A few minutes ago it has crashed while getting deal.
Error :
Inner Exception 1:
JsonSerializationException: Error converting value {null} to type 'System.DateTime'. Path 'add_time', line 1, position 578.

Inner Exception 2:
InvalidCastException: Null object cannot be converted to a value type.

How to update a custom field of an entity?

Hi,
I think from here is the problem (this line; i don't have returned an customfield with length 40):

I need to update the person fields: like address
I will show what i have returned(the json object, see below "postal_address" and all fields):

{
"success": true,
"data": {
"id": 7517,
"company_id": 333,
"owner_id": {
"id": 9055552398,
"name": "888",
"email": "888",
"has_pic": false,
"pic_hash": null,
"active_flag": true,
"value": 888
},
"org_id": null,
"name": "gmail.com",
"first_name": "gmail.com",
"last_name": "",
"open_deals_count": 0,
"related_open_deals_count": 0,
"closed_deals_count": 0,
"related_closed_deals_count": 0,
"participant_open_deals_count": 0,
"participant_closed_deals_count": 0,
"email_messages_count": 3,
"activities_count": 0,
"done_activities_count": 0,
"undone_activities_count": 0,
"reference_activities_count": 0,
"files_count": 0,
"notes_count": 1,
"followers_count": 1,
"won_deals_count": 0,
"related_won_deals_count": 0,
"lost_deals_count": 0,
"related_lost_deals_count": 0,
"active_flag": true,
"phone": [
{
"label": "",
"value": "121312312321",
"primary": true
}
],
"email": [
{
"label": "",
"value": "xxxgmail.com",
"primary": true
}
],
"first_char": "m",
"update_time": "2019-10-03 07:01:24",
"add_time": "2019-10-01 09:10:26",
"visible_to": "7",
"picture_id": null,
"next_activity_date": null,
"next_activity_time": null,
"next_activity_id": null,
"last_activity_id": null,
"last_activity_date": null,
"last_incoming_mail_time": "2019-10-03 07:01:00",
"last_outgoing_mail_time": "2019-10-02 17:57:00",
"ef81aec5402268d5860c8dbfd2704c167a637e17": null,
"b485548aa0d5509a066eed2449a78f409977d3cd": null,
"9a8bd76c75787157d973303cbe68a1afe47a8cf6": null,
"ea9b9368d874845341b252eaaf75dac16b2a5b7e": null,
"b22b376a77834be3bde1d69565d9248779126a8d": null,
"131ea976ce5d4f2a9b2f698d3c67d4b3f4acbcf1": null,
"label": null,
"5193fc51b56f8b1845aafccf34d994cf6042b7d4": null,
"im": [
{
"value": "",
"primary": true
}
],
"postal_address": "157 Adelaide St W,Toronto,CA",
"postal_address_subpremise": null,
"postal_address_street_number": "157",
"postal_address_route": "Adelaide Street West",
"postal_address_sublocality": "Old Toronto",
"postal_address_locality": "Toronto",
"postal_address_admin_area_level_1": "Ontario",
"postal_address_admin_area_level_2": "Toronto Division",
"postal_address_country": "Canada",
"postal_address_postal_code": "M5H 1P9",
"postal_address_formatted_address": "157 Adelaide St W, Toronto, ON M5H 1P9, Canada",
"notes": null,
"birthday": "2019-09-20",
"job_title": null,
"0d207ccc37bc39a39bd8583ae59c8a9de34ddabd": null,
"e366acb4568cd4709050930608a33d0f51caae03": null,
"584c954714f3dcc48400b945843bfc7ee962f2a2": null,
"c728280ba88a3a90461387daf47b4cf38d7327ba": null,
"org_name": null,
"cc_email": "[email protected]",
"owner_name": "xxx"
},
"additional_data": {
"dropbox_email": "[email protected]"
},
"related_objects": {
"user": {
"9052398": {
"id": 9052398,
"name": "Patricia Whitney",
"email": "xxx",
"has_pic": false,
"pic_hash": null,
"active_flag": true
}
}
}
}

How to Add a Person with a CustomField

Hi David,
I'm creating a new Person with my CutomFileds. The Person is created correctly, but the custom field on pipedrive is always null.

this is an example code

private async bool AddPerson(string name, string mail, string license)
{
         NewPerson curPerson = new NewPerson(name);
         curPerson.Email.Add(new Email {Value= mail});
         curPerson.CustomFields.Add(myCustomFieldApiKey, new MyCustomFileds(license));
         var res = await client.Person.Create(curPerson); 
         ......
}

public class MyCustomFileds : ICustomField
{
        public string License { get; set; }
        public MyCustomFileds(string license)
        {
            License = license;
        }
}

what's wrong?

Thanks
Ema

WARNING: User endpoints with "active_flag" don't work expectedly

Hey!

Just a heads up.

Pipedrive introduced a bug two weeks ago that made User endpoints containing "active_flag" only work correctly with "0" (false) and "1" (true) values. The endpoints don't validate the input and the documentation is wrong. So this makes IUsersClient behave unexpectedly in some situations.

Video demonstrating the issue: https://www.youtube.com/watch?v=cuJ4Hwu2ghA (I don't show that "0" and "1" work because I didn't know this workaround when I made the video.)

I will post here when they fix the issue.

How to read a CustomField

How do I read a custom field form a deal object? I only seem to be able to return Pipedrive.CustomFields.StringCustomField rather than the actual value from the object.

Error on create/update person, Activity or Deal objects

Hi,

I am facing the Api call issue while create/update person, Activity or deal. Error message - “Internal Server Error occurred. Pipedrive staff was notified about this.”.
It was working fine a day ago and updated the latest version with pipedrive.net as well.

Really appreciate your help.

Thanks,
Satya

Cannot update a person with customFields

Hi David,
I need a way to update a person address, based on zip/code or postal_address!!!
I've made my own method(PUT-REST and JSON) in order to update fields for a person.
Here is my small example:

        PersonUpdate personUpdate = new PersonUpdate();
        List<Phone> lPhones = new List<Phone>();                 
        
        //customFields.Add("phone", new StringCustomField(phone));      
        //customFields.Add("postal_address", new AddressCustomField(postalcode));
        try
        {
            //Person pExUpdate = await PipedrivePerson.Person.Get(id);
            
            Dictionary<string, string> customFields = new Dictionary<string, string>();
            customFields.Add("postal_address", address1+","+city+","+country);
            customFields.Add("postal_address_postal", postalcode);
            customFields.Add("phone", phone);
            customFields.Add("email", email);
            customFields.Add("postal_address_route", address1);
            customFields.Add("postal_address_country", country);
            customFields.Add("postal_address_locality", city);

            //pExUpdate.CustomFields = customFields;               
            //lPhones.Add(new Phone() { Label = "", Primary = true, Value = phone });
            //pExUpdate.Phone = lPhones;

            var personFields = JsonConvert.SerializeObject(customFields);
            MakePutAction(personFields, urlupdateField);
            //Person pUpdate=await PipedrivePerson.Person.Edit(id, personUpdate);
            //pExUpdate.ToUpdate();

RateLimit Broken

Becasue of the way the Pipedrive hand back rate-limit values, the current RateLimit functionality is broken.
Pipedrive hand back the number of seconds until the current rate-limiting period is over using the header 'x-ratelimit-reset'. The current implementation is expecting this to be in the form of epoch seconds.

I am currently in discussions with Pipedrive as to why the 'x-daily-requests-left' header (outlined in https://pipedrive.readme.io/docs/core-api-concepts-rate-limiting) is not returned in responses, and if they add this, I will look to add this header to the RateLimit class in the future when it becomes available.

Rate limiting

Hi @DavidRouyer,

As described in the following link, Pipedrive has a rate-limiting implemented to their API:
https://pipedrive.readme.io/docs/core-api-concepts-rate-limiting

I tested this scenario calling their API and the result is that, after I reach the two-seconds interval limit, the client throws a TooManyRequestsException. Ok, this makes sense.
Although, we have another class (RateLimitExceededException), with properties like Limit, Reset and Remaining that would help a lot to set wait times in my application.
The question is: am I misusing the client and, because of that, I am not able to get to the RateLimitExceededException? Or is it only a misunderstanding by myself?

Their page explains that, if we reach the rate limit, the API is going to send a 429 response code.
If I am not wrong, the code does not exactly follow this:

static readonly Dictionary<HttpStatusCode, Func<IResponse, Exception>> _httpExceptionMap =
	new Dictionary<HttpStatusCode, Func<IResponse, Exception>>
	{
		{ HttpStatusCode.Unauthorized, GetExceptionForUnauthorized },
		{ HttpStatusCode.Forbidden, GetExceptionForForbidden },
		{ HttpStatusCode.NotFound, response => new NotFoundException(response) },
		{ (HttpStatusCode)422, response => new ApiValidationException(response) },
		{ (HttpStatusCode)429, response => new TooManyRequestsException(response) },
		{ HttpStatusCode.InternalServerError, response => new InternalServerErrorException(response) },
		{ HttpStatusCode.NotImplemented, response => new NotImplementedException(response) }
	};


static Exception GetExceptionForForbidden(IResponse response)
{
	string body = response.Body as string ?? "";

	if (body.Contains("rate limit exceeded"))
	{
		return new RateLimitExceededException(response);
	}

	if (body.Contains("number of login attempts exceeded"))
	{
		return new LoginAttemptsExceededException(response);
	}

	if (body.Contains("abuse-rate-limits") || body.Contains("abuse detection mechanism"))
	{
		return new AbuseException(response);
	}

	return new ForbiddenException(response);
}

From the above pieces of code, we can see that we are only going to get a RateLimitException if the response is Forbidden (403), right?

I think that I understood what happened: although they state this:

If you exceed the rate limit, our API will start rejecting your requests and you'll receive an error response of HTTP 429 "Too Many Requests" in the body:

... they also send the HTTP 429 status as the code for the response. So the 429 status code could be read from the body AND the response code. Practically, I do not think this makes sense to send the response code in the body if it is the same code from the response, but this is what happened in my tests.

I appreciate if you can review this issue and confirm if I am making some mistake here.

Kind regards,
Geasi Puozzo

Modifying PersonCustomField

So I have a routine in my project that is attempting to modify the value of a specific a PersonCustomField. The value associated with the key I need updating is a string, however. Looking at the available functionality, it appears as if I can only set the value to be a numeric datatype. Unless I'm missing something in my logic. Sample code below.

            var personFields = person.CustomFields;
            var personField = new PersonCustomField();
            personField.Value = Convert.ToInt32(armsId);    // Required, although I need to pass my armsId in a string datatype.
            person.CustomFields[armsIdFieldKey] = personField;

Any suggestions as to how I best handle this? Ultimately it would be best if I could define the datatype when I am initializing the new PersonCustomField. But I didn't see how to do this.

Auto Paging is not working

I believe the paging is not working with any client but I specifically tested it on the Activity Client with an integration test. - The default page size is 100 there are more than 100 activities in the sandbox. This test fails. I can see that the API Pagination is expecting items in the header which are no longer there.

            [IntegrationTest]
            public async Task ReturnsMultiplePages()
            {
                var pipedrive = Helper.GetAuthenticatedClient();
                var startFilters = new ActivityFilters();
                var allPages = await pipedrive.Activity.GetAll(startFilters);
                Assert.True(allPages.Count > 100);
            }

I put in a nasty hack in a branch I am using but I think there must be a better way to resolve this using your existing pattern.

ReadOnlyPagesCollection never has a next page:

        public async Task<IReadOnlyPagedCollection<T>> GetNextPage()
        {
            var nextPageUrl = _info.GetNextPageUrl();
           if (nextPageUrl == null) return null;

nextPageUrl is always null.

Error when creating file

Describe the bug
I get an error when i call _client.File.Create()
This stopped working a week ago 😭

Message
Error converting value {null} to type 'System.Int64'. Path 'data.file_size', line 1, position 201.
Stack:

 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)     
 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)     
 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)     
 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)     
 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)     
 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)     
 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)     
 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)     
 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)     
 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)     
 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)     
 at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)     
 at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)     
 at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)     
 at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value)     
 at Pipedrive.Internal.JsonHttpPipeline.DeserializeResponse[T](IResponse response)     
 at Pipedrive.Connection.Run[T](IRequest request, CancellationToken cancellationToken)     
 at Pipedrive.ApiConnection.Post[T](Uri uri, Object data, String accepts, String contentType)     
 at Pipedrive.FilesClient.Create(NewFile data) 

My method:

await _client.File.Create(new NewFile(new RawFile(_scans[0].PaperTemplate.Template.Replace(".docx", "") + ".pdf", _pdfFile, "application/pdf"))
{
    DealId = createdDeal.Id
});

Due date on Activities is not working

When adding an acitivity by using the NewActivity the due date is not working. The value is not passed correctly to PipeDrive and is pr default choosing today

File Upload

Hi David,
I'm stuck on file upload. I activated your "Task Create(NewFile data)" function. I worked on it but didn't achieve.

DueDate field data type parsing

A few JSON response body parsing exceptions seem to occur when handling the due_date field. These specifics files seem to have been affected.

public DateTime? DueDate { get; set; }

Models/Request/ActivityUpdate.cs
Models/Response/Activity.cs
Models/Response/DealActivity.cs

Testing out an API request/response pair accordingly might shed some light on this. In my own forked project I changed the data type to string and had more consistent parsing results.

Test

This is a test

Missing Lead functions

I just added in the missing Lead create function in my fork and there are some weird issues. The PD lead endpoint follows the same format as the deal endpoint but there are some differences.

Deal endpoint allows null properties, leads does not.
Deal endpoint accepts visibility as an integar, leads accepts it as a string
Deal endpoint receives value as a double, leads receives it as an object

This means if you use the same pattern as every other endpoint then it doesn't actually work because it needs to be serialized differently.

I am going to do a quick hack to make it work in my code but posting this to save anyone else time who decides to try to add those endpoints

pipedrive.Person.GetByEmail(EmailAddress) missing

Hi, We use to have pipedrive.Person.GetByEmail(EmailAddress) at person object in 0.4.0 version and now its missing. Can you please help us in achieving this EmailAddress based search in the latest version.

Updating a deal overwrites its value

var editDeal = deal.ToUpdate();
editDeal.Status = DealStatus.won;
await client.Deal.Edit(deal.Id, editDeal);

This snippet will not only update the deal's status but also set its value to 0. This is not the case when I update the deal using Postman.

NewDeal.CloseTime not assigned when pushing into Pipedrive

Great project by the way! Makes it a whole lot easier to work with their API. A lifesaver!

So I am creating a NewDeal and have noticed when I have assigned a CloseTime value, the Pipedrive Deal doesn't reflect such. Have placed a breakpoint in my code and see the CloseTime value appearing in the NewDeal just prior to passing it to the API. But when I am invoking Deal.Create(newDeal) the result being passed back shows null for CloseTime.

Any suggestions?

Consuming Organization with Custom Fields

Hi David!

The organization's custom fields values are returning empty and I can't figure out what is wrong with my code:

Organization from Pipedrive screen:
Organization

Organization from pipedrive-dotnet:
{ "custom_fields": { "d69d827d846356c40445411bd60d0244edf936f9": {}, "ee03456d7963cbfff17ec7cd3360d669850a0a57": null, "b558fa523aeec8426093cec7adfdf1d20c1c55f8": {}, "25194dc3627fee0d24d0c5a2d0b3476109481cd3": null, "b11cc4c9548de93ca006d53be75c941228efb311": null, "283fcf884a0ab6dab5d2b1164116dd84df0801ab": null, "ce786d20752af44410c3529a348505ce80518fa9": null, "2f227d24d050312aeb20af373cb91a9f98723867": null, "d80787a1ed7af1854f2afca531329768bfa5de7e": null, "bf90b7d12d092c4f5cd4fcf5dde11560adcf5335": null, "5c30f688dfe67340720f11ef30974683ba9d6ac4": null, "c7670d435ba305c4eb4b3d209d52c636cff28a19": null, "32156f3464fbd3d62cbeb20f84d4a220f330255c": null, "b0b4b8f01ba944c93db46b1708a183984cb5f6dc": null, "22f204d3ca74a5893ef5b1d880fc38dc0bef53d2": null, "247adc02f7b234ca39df890fa9551f49f848ebd1": {}, "ec742597cbd8f4adee36b483ec8d19337bf8a749": null, "118289dd7ce576cd2c9f458d532675f05b322f24": null, "d77c2ca1272d9b35420a7168fbcf27d331f763aa": null, "0131d9620b7f45f4453a08f0b5b0cecaabde9b12": null, "2a9991503d5c70f879168090ce1719a58b2ad282": null }, "id": 72660, "company_id": 2423203, [...]
I need to retrieve all custom fields and I tried to consume just ["0131d9620b7f45f4453a08f0b5b0cecaabde9b12"] with no success too. I thought that all fields would return filled automatically in the organization request. - Could you please help me out?

Thank you for sharing this library. - Great work!

Specific BaseAddress

From the example in the readme file it looks like this library requires a 'company.pipedrive.com' base address. However, if I set up my own http client I can just make calls to https://api.pipedrive.com/v1/persons?api_token=<token> with the specific token for an organization in place.

Is there a different constructor where I don't need to set a 'company.pipedrive.com' base address?

Search Organization by custom fields

hi, I want to search for an organization through a custom field, but it finds me all the organizations that contain 70, I tried to enter ExactMatch both true and false but it doesn't work. Any suggestions?
thank you very much

        Dim filtriRicerca As New OrganizationSearchFilters()
        filtriRicerca.Parameters.Add("custom_fields", "COD. CLIENTE")
        Dim Organizations = Await Pipedrive.Organization.Search("70", filtriRicerca)

Unable to update Person.Email

Describe the bug
Unable to UPDATE a person's email address using EDIT

To Reproduce
var currentPerson = client.Person.Get(personId).Result;
currentPerson.Email = new List { new Email{ Primary = true, Label = "work", Value = @"[email protected]" } };
var personUpdate = currentPerson.ToUpdate();
var res2 = client.Person.Edit(personId, personUpdate).Result;

It seems to be PUTing the right data but it just wont update
image

Expected behavior
Email address to appear in Pipedrive

.NET 4.5 support

Hi, I have an issue while try to install the pipedrive package through the Nuget Package Manager Console or through Package solution manager. It says that " Could not install package 'Pipedrive.net 0.5.18'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author ". Currently my project is in 4.5 framework and while i try to install it , it gave me this error. Please let me know your thoughts on this. Thanks !

Screenshots
image

Leads fails to map to null person ID

Leads.GetAll() does not work if a lead doesn't have a person record. This field can legitimately be null so needs to be changed to a nullable long on the AbstractLead model.

Api Deal Products Breaking Changes

Describe the bug
Pipedrive api changed to update PUT prices to be sent as an array of objects instead of an object : https://developers.pipedrive.com/changelog/post/breaking-change-in-products-endpoint-and-webhook

Also breaking GetProducts from deal since it was using the same model

Created a PR with a fix
I am running from my updated dll at the moment.

To Reproduce
Steps to reproduce the behavior:

  1. Fetch deal products

Expected behavior
Return products of Deal

Screenshots
Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'System.Collections.Generic.Dictionary`2[System.String,Pipedrive.ProductPrice]' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly
Path 'data[0].product.prices', line 1, position 939.

Change 'IntCustomField' to 'LongCustomField'

Numerical int custom fields should be updated to long custom fields as int greatly restricts the API usage.

I noticed that a corresponding Pull Request has already been submitted. I also added a few comments that helped get the logic working for me locally.

How to create/update a multiple options field in custom fields

I have a custom field in pipedrive set up as following :
image
image

How to create this kind of multiple options field using the client, there is no CustomField class which looks like an array of options ?

    var customFields = new Dictionary<string, ICustomField>();

   var optins = new List<string>()
    {
        "Newsletter",
        "Communication"
    };
    customFields.Add("Optins", <how to put the optins array here ?>);

    await _client.Person.Create(new NewPerson("Test")
    {
        Email = new List<Email>() { new Email() { Label = "Professional", Value = "[email protected]" } },
        CustomFields = customFields
    });

Add Subscriptions

As far as I understand, the Subscriptions API isn't yet supported. That would be a great addition.

Deal value - integer value

The value field on the Deal object is of type long meaning it is not possible to get/upload deals with non-integer values.
We will be looking to create a pull request in the next few weeks, would you be able to look at it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.