Rest Connector Metadata Issue

  • 81Views
  • Last Post 25 April 2019
0
votes
Vlad Shmulskyi posted this 16 April 2019

Hi,

I'm working on integration between SalesForce and Cloud App via REST connector. When I performed initial sync it was successful, according to history state column. Then I performed the Update operation on SalesForce side and run the sync again I got the error: "Key cannot be NULL for Update operation". Another interesting point - in excel file with error details value for "ThisId" (from cloud app) was missed.

My guess is that Insert operation during initial sync went wrong and Id's from my app were not saved to Skyvia's mapping tables.

Could you please take a look at our API and provide correct metadata for our service? 

 

Order By: Standard | Newest | Votes
0
votes
Vlad Shmulskyi posted this 16 April 2019

Here is our current metadata (just copy to json file and apply autoformat):

 

{ "Metadata": [ { "Name": "Contact", "Url": "/Contacts", "ResultPath": "", "Columns": [ { "Name": "Id", "APIPath": "Id", "DbType": "Int32", "Primary": true, "Createable": false, "Updateable": false }, { "Name": "FirstName", "APIPath": "FirstName", "DbType": "String", "Required": false }, { "Name": "LastName", "APIPath": "LastName", "DbType": "String", "Required": true }, { "Name": "Email", "APIPath": "Email", "DbType": "String", "Required": true }, { "Name": "Phone", "APIPath": "Phone", "DbType": "String", "Required": true }, { "Name": "UpdatedDate", "APIPath": "UpdatedDate", "DbType": "DateTime", "Required": false }, { "Name": "IsActive", "APIPath": "IsActive", "DbType": "Boolean", "Required": false }, { "Name": "CreatedDate", "APIPath": "CreatedDate", "DbType": "DateTime", "Required": false } ], "InsertOperation": { "UrlSuffix": "", "Method": "POST", "ReturningStrategy": { "Type": "Row" }, "InputType": "JsonBody" }, "UpdateOperation": { "UrlSuffix": "/", "Arguments": [ { "ColumnName": "Id", "ParameterName": "contact_id", "ParameterType": "UrlPath" } ], "Method": "PUT", "ReturningStrategy": { "Type": "Row" }, "InputType": "JsonBody" }, "DeleteOperation": { "UrlSuffix": "/", "Arguments": [ { "ColumnName": "Id", "ParameterName": "contact_id", "ParameterType": "UrlPath" } ], "Method": "DELETE" } } ] }

0
votes
Mariia Zaharova posted this 18 April 2019

We will study your case and reply you back as soon as possible.

 

Best regards,

Mariia

0
votes
Vlad Shmulskyi posted this 22 April 2019

Mariia,

As an alternative, you can provide an example in what format your application expects response for insert/update operations.

As for now our application responses to successful insert operation with code 201, '{ResourceName}/{Id}' as resource location and object with an inserted id value in the body.

Thank you in advance

 

0
votes
Mariia Zaharova posted this 22 April 2019

Please try to change this code for Update and Delete operations:

"UrlSuffix" : "/"

change it to this code:

"UrlSuffix" : "/<contact_id>"

 

Please notify us about the results.

0
votes
Vlad Shmulskyi posted this 22 April 2019

Thanks for your reply

I've changed the code as you suggested, but result was the same: "Key cannot be NULL for Update operation."

According to request logs - Skyvia didn't perform update request to my cloud app. That's why I still think the issue is in Insert operation - generated id form my DB wasn't saved to Skyvia's mapping tables.

Updated metadata I used:

{ "Metadata": [ { "Name": "Contact", "Url": "/Contacts", "ResultPath": "", "Columns": [ { "Name": "Id", "APIPath": "Id", "DbType": "Int32", "Primary": true, "Createable": false, "Updateable": false }, { "Name": "FirstName", "APIPath": "FirstName", "DbType": "String", "Required": false }, { "Name": "LastName", "APIPath": "LastName", "DbType": "String", "Required": true }, { "Name": "Email", "APIPath": "Email", "DbType": "String", "Required": true }, { "Name": "Phone", "APIPath": "Phone", "DbType": "String", "Required": true }, { "Name": "UpdatedDate", "APIPath": "UpdatedDate", "DbType": "DateTime", "Required": false }, { "Name": "IsActive", "APIPath": "IsActive", "DbType": "Boolean", "Required": false }, { "Name": "CreatedDate", "APIPath": "CreatedDate", "DbType": "DateTime", "Required": false } ], "InsertOperation": { "UrlSuffix": "", "Method": "POST", "ReturningStrategy": { "Type": "Row" }, "InputType": "JsonBody" }, "UpdateOperation": { "UrlSuffix": "/<contactid>", "Arguments": [ { "ColumnName": "Id", "ParameterName": "contactid", "ParameterType": "UrlPath" } ], "Method": "PUT", "ReturningStrategy": { "Type": "Row" }, "InputType": "JsonBody" }, "DeleteOperation": { "UrlSuffix": "/<contactid>", "Arguments": [ { "ColumnName": "Id", "ParameterName": "contactid", "ParameterType": "UrlPath" } ], "Method": "DELETE" } } ] }

0
votes
Vlad Shmulskyi posted this 25 April 2019

Are there any updates?

Close