API - Discord Import

Can I call API in needle tools

Original Post on Discord

by user 823113958117474354

@marcel :cactus:

by user 823113958117474354

What api do you want to call? You are in the web so you can e.g. make calls to web apis of course

@marcel :cactus: My API I want to call is : https://catfact.ninja/fact

by user 823113958117474354

And I want to implement it on Unity through text

by user 823113958117474354

Running on Unity β†’ OK

by user 823113958117474354

But needle tools is not display my API.

by user 823113958117474354

You have to implement it in typescript if you want it to run in the web / needle engine

Where is typescript file located?

by user 823113958117474354

How I find it ?

by user 823113958117474354

You create it. Please read about it in Needle Engine Scripting | Needle Engine Documentation

Okay, I got it.

by user 823113958117474354

Thank for your support

by user 823113958117474354

@marcel :cactus: I don’t have document to read call API in TS and render it in C# for object to display like image, text … . Can you help me.

by user 823113958117474354

Screen_Shot_2022-11-03_at_14.08.40.png

by user 823113958117474354

Hello, you can not render images or texts in C# from typescript - you can write typescript / javascript to make api requests and display that in the browser or you can write C# code to enhance the editor or make requests in Unity (but only in Unity and not in the browser)

Unity I run test is Okay

by user 823113958117474354

But my project required test on browser. API is not occure

by user 823113958117474354

I currently not found the way to request API from typescript which will render c# to apply for object

by user 823113958117474354

I mean that https://www.youtube.com/watch?v=XIbZDz_p6vE&t=133s

by user 823113958117474354