Question

Page not found when executing an API POST call

  • 15 April 2024
  • 3 replies
  • 76 views

Userlevel 2
Badge

Hello,

 

I was referencing this community post Upload multiple files using the Universal GUI to implement the bulk drag and drop file insertion and I have encountered an issue with the target table’s page not being found when I execute the API call.

By using an HTTP request platform, I have made the simplest call possible to the table in question (both with and without authentication), for testing purposes, making sure to include the correct URL (the pattern being “{serverURL}/{appIDorAlias}/{table name}”), however, I always get a 404 status in return.

Does this have anything to do with the API endpoint not being visible and/or is there any further configuration that has to be done (in IAM, for instance), or am I simply missing anything?

 

Thank you.


3 replies

Userlevel 6
Badge +4

Hello @Valentin,

The URL pattern is {serverURL}/{metaSourceIDorAlias}/{appIDorAlias}/{table name}.

So for example, if we assume the following:

  • The server URL is https://localhost/indicium
  • We want to use IAM as the metasource
  • The application alias is my_appl
  • The table ID is my_table

This would give you the following URL:

https://localhost/indicium/iam/my_appl/my_table

Alternatively, it would be /sf/ to use the SF as the metasource. Other than that, the user that you are authenticating with must have sufficient permissions to access the application and the table in question. To validate whether you can access the application, you can perform a GET request on the following URL:

https://localhost/indicium/iam/my_appl 

I hope this helps

Userlevel 2
Badge

Hello @Valentin,

The URL pattern is {serverURL}/{metaSourceIDorAlias}/{appIDorAlias}/{table name}.

So for example, if we assume the following:

  • The server URL is https://localhost/indicium
  • We want to use IAM as the metasource
  • The application alias is my_appl
  • The table ID is my_table

This would give you the following URL:

https://localhost/indicium/iam/my_appl/my_table

Alternatively, it would be /sf/ to use the SF as the metasource. Other than that, the user that you are authenticating with must have sufficient permissions to access the application and the table in question. To validate whether you can access the application, you can perform a GET request on the following URL:

https://localhost/indicium/iam/my_appl 

I hope this helps

Hello, thank you for the response!
 

I have tried using IAM as the metasource before and it still does not work. Peculiarly enough, it does perform a GET call with SF as the metasource (“{serverURL}/sf/...”), but the POST call still gives a 403. This might be due to the fact that the azure file column is mandatory (I will call it “attachment”) in the target table. By debugging, when using the upload zone, the file itself passes through the “uploadFile” function in the script, but it breaks when trying to stringify the payload content at the end, thus, the payload ultimately has an empty “attachment” parameter . So now the issue seems to be the fact that the file itself is not being parsed correctly and, since it is mandatory in the target table, it is returning a 403 forbidden status.

Userlevel 6
Badge +4

Hello @Valentin,

The 403 response indicates that your request violates your permissions in some kind of way. To list a few options for a POST call on a table:

  • You are not allowed to insert records on this table (no add permissions)
  • You are providing a property in your JSON body that corresponds to an unauthorized, hidden or readonly column. Note that this includes when a layout procedure sets a column to hidden or readonly. You can only provide values for ‘regular’ columns.
  • You are providing a value for a lookup column that falls outside of the locked lookup prefilters for that user.

As to why the IAM metasource is not working, I suspect that this is an issue with permissions as well, or an incorrect application alias or ID. But it's hard to say for sure without more information regarding the error.

I hope this helps.

Reply