davidrouyer / pipedrive-dotnet Goto Github PK
View Code? Open in Web Editor NEWPipedrive.net is an async .NET Standard client for pipedrive.com
License: MIT License
Pipedrive.net is an async .NET Standard client for pipedrive.com
License: MIT License
get /activitityFields can return null for addresses at least in my case and thus can't be serialized/de-serialized with JSON.
https://developers.pipedrive.com/docs/api/v1/#!/ActivityFields
Example:
{
"id": null,
"key": "location_country",
"name": "Country",
"field_type": "varchar",
"edit_flag": false,
"active_flag": true,
"is_subfield": true,
"mandatory_flag": true
}
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
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.
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.
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.
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
}
}
}
}
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
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
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)
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
});
As far as I understand, the Subscriptions API isn't yet supported. That would be a great addition.
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?
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:
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.
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.
If I am iterating through Person records and see one of these, what's the most effective way to cast/convert the value to a C# DateTime object?
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 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!
expected_close_date needs to be added to both newdeal and dealupdate.
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
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
"last_http_status":"Error"
).GetAll()
to get all the webhooks.Expected behavior
All webhooks are returned.
Hi David,
I'm stuck on file upload. I activated your "Task Create(NewFile data)" function. I worked on it but didn't achieve.
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.
I have a custom field in pipedrive set up as following :
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
});
Hey,
Is it possible that you can't update a "multiple options" field? Am I missing something?
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.
The API allows retrieving all activities of an organization: https://developers.pipedrive.com/docs/api/v1/?_ga=2.99355038.1281475430.1599047781-200809376.1583317737#!/Organizations/get_organizations_id_activities
I suppose this is currently not implemented.
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.
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.
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?
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
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();
Hi, I see that there is no support for the "Add a follower to a person" method. Is this planned?
https://developers.pipedrive.com/docs/api/v1/#!/Persons/post_persons_id_followers
This is a test
A few JSON response body parsing exceptions seem to occur when handling the due_date field. These specifics files seem to have been affected.
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.
As of PipeDrive's docs, they support OAuth:
https://pipedrive.readme.io/docs/marketplace-oauth-authorization
The library is already compatible with OAuth?
If not, do you have plans to make it?
If yes, how can we use the library with OAuth?
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?
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.
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
Expected behavior
Email address to appear in Pipedrive
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.
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.
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.
The NewDealsProduct model does not have support for the Tax field as detailed in https://developers.pipedrive.com/docs/api/v1/Deals#addDealProduct
Would be beneficial to add this and presumably DealProductUpdate
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)
...
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 !
It seem the label field is undocumented on API but is covered in this tutorial: https://pipedrive.readme.io/docs/working-with-labels#section-adding-a-label-through-updating-the-deal-organization-person-entity
I think we need Label
field on the PersonUpdate
object.
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
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.