API for Creation Algorithms

  • 0
  • 1
  • Problem
  • Updated 2 months ago
  • In Progress
Hi,
I have encountered this error when I try to provide the “fileReferenceID” to the curl “Create Algorithm” in my bash script.
{“errorMessage”:”Input error: unable to convert input to com.dmsuite.swagger.model.Algorithm”}

The curl in consideration is this:
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization:'$AUTHID -d '{"algorithmName": "Cap","algorithmType": "LOOKUP","fileReferenceID":'$IDFILE'}' 'http://'$ip_port'/masking/api/algorithms'

I take the “fileReferenceID” from the curl “Upload File” that I perform  previously.

Thank you,
Regards.
Photo of Alessandro

Alessandro

  • 100 Points 100 badge 2x thumb

Posted 2 months ago

  • 0
  • 1
Photo of Mouhssine SAIDI

Mouhssine SAIDI

  • 4,862 Points 4k badge 2x thumb
Hi,

Here is what i found on delphix doc.

API calls involving file upload are noteworthy because the generated curl from the Masking API client will be missing the parameter referencing the file; as such, those commands from the Masking API client will not work.

Instead, below are examples of working requests and responses for API calls involving file upload.

https://maskingdocs.delphix.com/Delphix_Masking_APIs/Masking_Client/API_Calls_Involving_File_Upload_...

Regards,

Mouhssine


(Edited)
Photo of Alessandro

Alessandro

  • 100 Points 100 badge 2x thumb
Hi,

I have already seen the documentation but unfortunately I could not solve my problem.

Any other idea to solve the problem?

Regards,

Alessandro.
Photo of Anders Karlsson

Anders Karlsson

  • 180 Points 100 badge 2x thumb
Dear Alessandro,

Thanks for your question. The elements in the JSON is case sensitive and I have noticed in your example that "fileReferenceId" is written as "fileReferenceID".

Please try and change the element name.

Kind regards,

Anders

Photo of Alessandro

Alessandro

  • 100 Points 100 badge 2x thumb
Dear Anders,

Thanks for your answer, but the problem is not this.

I have changed the element name but the same error still appears. 

{“errorMessage”:”Input error: unable to convert input to com.dmsuite.swagger.model.Algorithm”}

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization:'$AUTHID -d '{"algorithmName": "Cap","algorithmType": "LOOKUP","fileReferenceId":'$IDFILE'}' 'http://'$ip_port'/masking/api/algorithms'

Regards,

Alessandro



Photo of MichaelT

MichaelT, Official Rep

  • 856 Points 500 badge 2x thumb
Hi Alessandro,
In the curl command you posted, you still have the element as "fileReferenceId":'$IDFILE' ... can you confirm that you changed the json element name to fileReferenceID. Note the capital D in fileReferenceID. I believe that is what Anders was asking you to change. It is case sensitive.

Thanks,
Michael
(Edited)
Photo of Alessandro

Alessandro

  • 100 Points 100 badge 2x thumb
Hi Michael,

In the first curl I have "fileRefenceID" but in the second curl i have "fileReferenceId".

Anyway I tried in both cases but it doesn't work.

Thanks,

Alessandro
Photo of MichaelT

MichaelT, Official Rep

  • 856 Points 500 badge 2x thumb
You're right and I had it backwards. Apologies.
Photo of Anders Karlsson

Anders Karlsson

  • 180 Points 100 badge 2x thumb
Hi Alessandro,

Hope all is well. I'm just following up on your enquiry. If there is still an issue, the best is to get diagnostics and to open a support case. 

Please let me know.

Kind regards, 

Anders