Private Cloud gives unexpected responses

Posts about the simPRO API. Help/support/how-to etc.
Forum rules
  • Check the documentation first. Before posting questions, please check the documentation to ensure it doesn't already cover what you need.
  • No spam. All automated messages, advertisements, and links to competitor websites will be deleted immediately.
  • Post in relevant sub-forums only. Messages posted in the wrong topic area will be removed and placed in the correct sub-forum by moderators.
  • Respect other users. No flaming or abusing fellow forum members. Users who continue to post inflammatory, abusive comments will be deleted from the forum after two warnings are issued by moderators.
  • Harassment. No threats or harassment of other users will be tolerated. Any instance of threatening or harassing behavior is grounds for deletion from the forums.
  • Adult content. No profanity or pornography is allowed. Posts containing adult material will be deleted.
  • Bandwidth. All images and signatures must be 500 x 500 pixels or smaller. Posts containing over-sized images and signatures will be removed.
  • Illegal content. No re-posting of copyrighted materials or other illegal content is allowed. Any posts containing illegal content or copyrighted materials will be deleted.
Post Reply
ThomasPollinger
Posts: 2
Joined: Mon Jan 23, 2023 10:09 pm

Private Cloud gives unexpected responses

Post by ThomasPollinger » Mon Jan 23, 2023 11:06 pm

HI,

We are in the process of migrating large amounts of data into simPRO using the API but have encountered difficulty when sending requests too fast.

I am aware that rate limiting has been implemented - viewtopic.php?f=3&p=5245#p5245
but according to the below thread private clouds like the one we are using shouldn't be affected as it is a .simprocloud.com endpoint.
viewtopic.php?f=2&t=1877

We have been able to consistently encounter this issue when uploading 300 customers in parallel (we can't post multiple as we require information contained within the customer response body even with the display=all parameter).
  • throttling the requests results in successful submission of all customers
  • submitting the customers in parallel results in 200 OK responses with no body
the endpoints we have been using are
/api/v1.0/companies/2/customers/individuals/?createSite=true
/api/v1.0/companies/2/customers/companies/?createSite=true
  • After an average of 70 submissions the responses no longer contain data (content length is zero)
  • The failure isn't linked to a specific customers data as fails occur after seemingly any number of successful responses (I have noted as low as 3 and as high as 137) and appears to be linked with how fast the requests are sent to the server.
The exact error we are encountering is that we receive a 200 OK response, but no customer data as can be seen in the below snippet from one of the affected responses.

Code: Select all

headers: {
    'strict-transport-security': 'max-age=31536000; includeSubdomains',
    'content-type': 'text/html; charset=UTF-8',
    'content-length': '0',
    connection: 'close',
    date: 'Sun, 22 Jan 2023 23:15:58 GMT',
    server: 'lighttpd'
  },
  rawHeaders: [
    'Strict-Transport-Security',
    'max-age=31536000; includeSubdomains',
    'Content-type',
    'text/html; charset=UTF-8',
    'Content-Length',
    '0',
    'Connection',
    'close',
    'Date',
    'Sun, 22 Jan 2023 23:15:58 GMT',
    'Server',
    'lighttpd'
  ],
  statusCode: 200,
  statusMessage: 'OK',
As seen above the response has a content-length of 0 which is problematic as we expect a response body. Are there any limits in place for private clouds we should be aware of? If it was rate limiting, we’d expect an 429 response code and not success 200.

Regards,
Thomas
Sindre
Posts: 493
Joined: Wed Apr 20, 2022 4:51 am
Location: Brisbane

Re: Private Cloud gives unexpected responses

Post by Sindre » Tue Jan 24, 2023 11:42 pm

Hi Thomas,
Thanks for reporting your experiences. As you mention there are not rate limiting implemented for private cloud so this should not affect your migration. We have not registered any general problems but you seem to hit some limitations on the server.

The post multiple function is intended for these kind of instances where you need to import a large amount of records and have been optimised to run efficiently.

I understand that you need the response data, but can you try using post multiple and use the id's returned to get the data after the customers have been created?

Regards
Sindre
API Developer | Simpro Software Group
Post Reply