Trying to make a call to the Figma API, nodes endpoint, from c++ in Unreal Engine.
void AMyTest::SendRequest(){
FString APIKey = "XXXXXXXXXX";
FString FILEKey = "YYYYYYYYY";
FString URL = "https://api.figma.com/v1/files/" + FILEKey + "/nodes?ids=202:595";
FHttpRequestRef reqRef = FHttpModule::Get().CreateRequest();
reqRef->SetURL(URL);
reqRef->SetVerb("GET");
reqRef->SetHeader(TEXT("X-FIGMA-TOKEN"), APIKey);
// line commented out but not working even including it
//reqRef->AppendToHeader(TEXT("User-Agent"), TEXT("X-UnrealEngine-Agent"));
reqRef->OnProcessRequestComplete().BindUObject(this, &AMyActor::OnResponseReceived);
reqRef->ProcessRequest();
}
With this, and after having made various variations of this script, the only that the Figma API keeps responding is “Bad request”.
Could anyone help pointing out what it is going in here.