Community
Showing results for 
Search instead for 
Do you mean 
Reply

500 API Response

New Member
Posts: 18
Country: USA

500 API Response

Our integration is running Ubuntu 14.04, PHP 7.0.2

 

Having issues diagnosing a 500 response. It seems to be an issues with the endpoints dealing with files: (a sample)

 

DELETE /Act.Web.API/api/attachments/history/63aeb017-15a5-410d-8099-0e948189b32a

POST /Act.Web.API/api/Documents - 19050

 

The only message we can get to go on is:

Object synchronization method was called from an unsyn (truncated...)

 

Does anyone have experience with this or help with how to diagnose the issue?

Employee
Posts: 46
Country: USA

Re: 500 API Response

I am not able to duplicate this issue, but I am calling the endpoints from windows using Postman.  I am setting up an Ubuntu machine and will try it with cURL, but it would really help if you could post the actual cURL that you are executing (delete the bearer key from the cURL before posting).  I am assuming other cURL calls (all using HTTPS) are working on this machine and it is only these attachments & document endpoints that are failing.

 

 

New Member
Posts: 18
Country: USA

Re: 500 API Response

The other endpoints are working, it seems to fail when a document is part of the payload. I'm currently putting together a payload.

The API endpoint currently does not have a TLS cert. Would that be a possible cause?

Employee
Posts: 46
Country: USA

Re: 500 API Response

If there is no TLS cert, try making the call with HTTP instead or try add the -k switch to the cURL to ignore a secure connect.

 

When posting:  Make sure you set the Content-Type: application/x-www-form-urlencoded

New Member
Posts: 18
Country: USA

Re: 500 API Response

[2018-01-12 12:51:32] local.INFO: array (
  0 => 'post',
  1 => 'api/attachments/history/d0ce244d-c999-4ea6-a00b-540973c9af59',
  2 =>
  array (
    'multipart' =>
    array (
      0 =>
      array (
        'Content-type' => 'multipart/form-data',
        'name' => 'Hole In One Quote',
        'contents' => '**REMOVED PDF**',
        'filename' => 'Hole In One Quote.pdf',
        'filetype' => 'application/pdf',
      ),
    ),
    'headers' =>
    array (
      'Accept' => 'application/json',
      'Authorization' => 'Bearer **REMOVED KEY**',
    ),
  ),
)
Employee
Posts: 46
Country: USA

Re: 500 API Response

Are you able to Attach the file from a windows machine that is not the same machine as  the API.  I am thinking maybe this is a file permission issue.  The API is using Network Services to upload the file to the Act! attachments folder in Documents/ACT/Databases/???/Attachments.

 

To confirm this is not that case, could you uploading the PDF threw the API's help documentation.  Those endpoints are in the Supplemental Files on the help docs.

New Member
Posts: 18
Country: USA

Re: 500 API Response

[ Edited ]

Endpoint

POST /api/attachments/history/{id}

Gave it an ID and File

 

Response

{
  "message": "Attachment already exists.  Delete the existing attachment to continue.",
  "attachment": {
    "displayName": "Quote.pdf",
    "fileExtension": ".pdf",
    "fileName": "\\\\*SERVER*\\*OUR_DB*\\Attachments\\Quote_636513625627424063.pdf",
    "fileSize": 72,
    "fileSizeDisplay": "72 KB",
    "fileType": "Adobe Acrobat Document",
    "lastModified": "2018-01-12T14:02:42-05:00",
    "personal": false
  }
}
New Member
Posts: 18
Country: USA

Re: 500 API Response

Ok, so i deleted the document and retried. It was successful, but the request took 45.49 seconds to process.

New Member
Posts: 4
Country: India

Re: 500 API Response

[ Edited ]

We are saving documents to

\\TSPLUS-94\Events-database files\Attachments

path TSPLUS-94 same machine. Is there anything you find wrong? btw, I am with "bsantore".

 

Employee
Posts: 46
Country: USA

Re: 500 API Response

That path should be find, I have not tried a UNC path, I will change it on my system to see if I can duplicate.  My question now is are you using a service account in the API application pool and does that account being used in the apppool have access to r/w to that UNC path?