Api Orchestrator php

Hi, I got so problems to use the api with php.
I want to create a php api which put value in queue(I already sucess in typescript with the same value), i can’t/don’t want to do it with cURL.
But when I call it, there is an error : failed to open stream: HTTP request failed! HTTP/1.1 401 Unauthorized.
And on My IIS there is this error : Abp.Authorization.AbpAuthorizationException: Current user did not login to the application!.

this is my php call :

 $postdata2 = json_encode(
      array(
        'itemData'=> array('Name'=>'testeur',
          'Priority'=> 'High',
          'DeferDate'=> '2023-02-15T09:33:19.667Z',
          'DueDate'=> '2023-02-15T09:33:19.667Z',
          'RiskSlaDate'=> '2023-02-15T09:33:19.667Z'
        )
      )
  );
 // var_dump($token);
 $test=56;
 $opts2 = array('http' =>
 array(
     'method'  => 'POST',
     'header'  => 'Content-Type: application/json\r\n'.
     'accept : application/json\r\n'.
     'X-UIPATH-OrganizationUnitId:'.$test.'\r\n'.
     'Authorization:Bearer '.$token.'\n',
     'content' => $postdata2
 )
);

  $context2  = stream_context_create($opts2);
  $result = file_get_contents('xxxxxxxxx/odata/Queues/UiPathODataSvc.AddQueueItem', false, $context2,-1, 40000);

Hello @leo.malet!

It seems that you have trouble getting an answer to your question in the first 24 hours.
Let us give you a few hints and helpful links.

First, make sure you browsed through our Forum FAQ Beginner’s Guide. It will teach you what should be included in your topic.

You can check out some of our resources directly, see below:

  1. Always search first. It is the best way to quickly find your answer. Check out the image icon for that.
    Clicking the options button will let you set more specific topic search filters, i.e. only the ones with a solution.

  2. Topic that contains most common solutions with example project files can be found here.

  3. Read our official documentation where you can find a lot of information and instructions about each of our products:

  4. Watch the videos on our official YouTube channel for more visual tutorials.

  5. Meet us and our users on our Community Slack and ask your question there.

Hopefully this will let you easily find the solution/information you need. Once you have it, we would be happy if you could share your findings here and mark it as a solution. This will help other users find it in the future.

Thank you for helping us build our UiPath Community!

Cheers from your friendly
Forum_Staff

I solved my problem it ws bc in my php code i use this ’ but I forgot that php will only use \r\n when there are " so i replaced all my ’ by " and it solved the problem.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.