Tests with the web test of the integration API

I’m doing tests for the implementation of the integration API in the url: https://i.materialise.com/api/demo/pricing-by-model-id-api.htm and I can not find any results.

They could guide me on its operation, I have an API Code but I only receive error messages.

Thank you.
Miquel

Hi Miquel,
I think you got an api code for the sandbox.
try it out on this site : https://imatsandbox.materialise.net/api/demo/

tx,
Wim

Yes, I have an api code for the sandbox but when I try it I ask for an id of the model, I have uploaded a couple of designs and I use the id given by i.materialise but I do not get an answer, it says it is not a valid id.

Is this api not valid to use from a php code?

best regards,
miquel regidor

Hi Miquel,

Try getting the model ID by uploading the file on this demo page:
imatsandbox.materialise.net/api/demo/upload-model-api.html

You can find some PHP examples here: github.com/imaterialise/api-sdk-php

Hi,

You can start by requesting your API credentials here: i.materialise.com/api/getting-started

After that, we’ll set you up with the access to our test site for developing the integration.

Let us know if you have more questions.

We haven’t been able to perform any successful test in the sandbox, even if we use our key. Could you please pass us a 3D model using which we could obtain the price applying our key?

In addition to that, could you please provide us with a “json” or “xml” code which we can use in this URL (https://imatsandbox.materialise.net/api/demo/pricing-by-parameters-api.htm) with our API key?

We need a code that could work properly and that could give us something besides an error. It always gives us an error which states that the price cannot be calculated for this material and it asks us to use the API “get Price by model ID”. We seek to calculate prices by parameters, not by ID.

Best regards,
miquel

Hi Miquel,

Let me go over your questions:

  1. If you need a 3D model for file uploading tests, you can look for it on platforms like Cults or Thingiverse.

  2. Pricing by parameters API and most of the other APIs can’t be used without an API key. We provide each user with a personal API key in order to properly authorize their applications in our system.

  3. An error that says that a price can’t be calculated for the given material is a standard error. It simply means that for certain materials the price can’t be calculated using the model parameters alone. In such cases, you should use Pricing by Model ID.
    .

We already got a personal API key delivered by you to our i.materialise profile so we get access to the test environment. We would like to get an “xml” or “json” code with a valid material reference so we get no errors. I have tried all materials that the API lists as avaibable and I have not managed to make it work. Maybe you could pass me a valid material code with which I can test the pricing API by Parameters?

best regards
miquel

Hi,

The JSON and XML requests shown in the demo pages are working examples. One of the materials that support pricing by parameters is Gray Resin.

Its material ID: 2e7b80e9-634b-485a-bc40-5e4324078b54
Finish ID: 0261af53-8fed-4854-a248-4b111d759f8d

1 Like

Thanks, with this data I have managed to perform a correct test on the web https://imatsandbox.materialise.net/api/demo/upload-model-api.html
I am developing a php application to connect a web with your api. I’m analyzing the code you have on github. “api-sdk-php / pricingByModelAPI.php” and the result I receive is unauthorized.
Could it be that the api that I have does not allow the direct connection from php?

best regards
miquel

Hi Miquel,

That’s most likely because you’re sending the request to our production site, while you currently have access only to our test site.
Make sure to address the pricing by model ID requests to https://imatsandbox.materialise.net/web-api/pricing/model
Exact URLs for each API endpoint, both for production and test site, can be found in the documentation.

1 Like

Thanks, I was already using the github code with the correct url.

api-sdk-php/blob/master/pricingAPI.php

Finally, the symbols of [] of the sample code were redundant and I had not noticed.

For now I can follow the development, thanks.

best regards,
miquel