HTTP Worker consume Magento

Phil (OmnisList) phil at pgpotter.co.uk
Fri Feb 5 14:47:24 UTC 2021


Hi Xavier,

How are you setting the headers in Omnis?

Presume a 2 column list
so a line would then be like:

llist.$add("Authorization",con("Bearer 
","2yjgjyg6GT9879jklhlklhjjklkjgh5gbbJ”))

regards
Phil Potter
Based in Chester in the UK.

On 05/02/2021 14:36, IT wrote:
> Hi Phil,
>
> No is oAuth1 but with curl commands from terminal I have retrieved data from magento
>
> The curl sequence  is:
>
> 1.   curl -X POST "http://mywesite.online/rest/V1/integration/admin/token" \
>       -H "Content-Type:application/json" \
>       -d '{"username”:”myuser", "password":"UStybk6hHYFGFFp"}'
>
>
> It returns a token like 2yjgjyg6GT9879jklhlklhjjklkjgh5gbbJ
>
> next use the token in the next curl command
>
> 2.   curl -X GET "http://mywesite.online/rest/V1/categories" -H "Authorization:Bearer 2yjgjyg6GT9879jklhlklhjjklkjgh5gbbJ”
>
>
> and you get categories from magento.
>
> In omnis i get 401 Unauthorized. Sure I’m sending something wrong from Omnis, but I got curl commands working at first time.
> Omnis seems more tricky.
>
> regards
>
> xavier
>
>
>
>
>> El 5 feb 2021, a las 15:00, Phil (OmnisList) via omnisdev-en <omnisdev-en at lists.omnis-dev.com> escribió:
>>
>> Hi Xavier,
>>
>> Is this Oauth2?
>>
>> I've successfully used Oauth2 in O$10.2 to authorize, and then get/set data.
>> That was in particular with Google calendars.
>>
>> regards
>> Phil Potter
>> Based in Chester in the UK.
>>
>> On 05/02/2021 13:45, IT wrote:
>>> Hi All,
>>>
>>> I can get the token from a magento ecommerce site using Omnis code, but i m unable to consume any things from the server beyond the token.
>>>
>>>
>>> If i do the same thing from macos terminal using curl I get data from magento
>>>
>>> curl -X GET "http://myecommerce.online/rest/V1/categories" -H "Authorization:Bearer 2u6j6tr382o1pmxv9a37i60ts50totj7”
>>>
>>>
>>> This works from terminal but trying to implement from Omnis code using the Omnis studio 10.1 HTTP worker sample window fails with a 401 Unauthorized (The consumer isn’t authorized to access %resources …)
>>>
>>> Instead the token is returned by the Omnis HTTP worker sample window.
>>>
>>> Any advice?
>>>
>>> regards
>>>
>>> xavier
>>> _____________________________________________________________
>>> Manage your list subscriptions at http://lists.omnis-dev.com
>>> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
>> _____________________________________________________________
>> Manage your list subscriptions at http://lists.omnis-dev.com
>> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com


More information about the omnisdev-en mailing list