Navigation

    Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. William Hatanaka
    W
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    William Hatanaka

    @William Hatanaka

    3
    Reputation
    87
    Posts
    170
    Profile views
    0
    Followers
    1
    Following
    Joined Last Online

    William Hatanaka Follow

    Posts made by William Hatanaka

    • RE: api - I can create a address ...

      @devansh-webkul
      I added the command Log::info() on method __construct(CustomerAddressRepository $customerAddressRepository) of the app/bagisto/packages/Webkul/API/Http/Controllers/Shop/AddressControler.php to check if all data I sending to api addresses/create is arriving.
      All data is arriving BUT the store() method is not executing...
      If I run by postman the store() method is executed...
      Do you have any ideia what I need to configure to execute correctly ?
      Please, could you help me?

      posted in General Discussion
      W
      William Hatanaka
    • RE: api - I can create a address ...

      @devansh-webkul
      I don't know if it is the right way to take a token...

      $client = new \GuzzleHttp\Client([
                  'headers' => [
                      'Accept' => 'application/json',
                      'Content-Type' => 'application/json',
                  ],
              ]);
      $response = $client->request('POST', config('global.ecsite.url').'/api/customer/login', [
                      'query' => ['token'=>'true'],
                      'form_params' => $data
                  ]);
      $responseData = json_decode($response->getBody(), true);
      $token=$responseData['token'];
      

      I take the token in this last line after login ..

      posted in General Discussion
      W
      William Hatanaka
    • RE: api - I can create a address ...

      @darkuser123
      I did the following things:

      1. I logged with a customer
      $client = new \GuzzleHttp\Client([
                  'headers' => [
                      'Accept' => 'application/json',
                      'Content-Type' => 'application/json',
                  ],
              ]);
      $response = $client->request('POST', config('global.ecsite.url').'/api/customer/login', [
                      'query' => ['token'=>'true'],
                      'form_params' => $data
                  ]);
      $responseData = json_decode($response->getBody(), true);
      $token=$responseData['token'];
      

      And after that I filled a array with the address data.

      $data=[
                      'address1' => ['Clock Tower'],
                      'city' => 'Dehradun',
                      'country' => 'IN',
                      'country_name' => 'India',
                      'phone' => '24833333001',
                      'postcode' => '222222',
                      'state' => 'UT',
                    ];
       $client = new \GuzzleHttp\Client([
                      'headers' => [
                          'Accept' => 'application/json',
                          'Content-Type' => 'application/json',
                          'Authorization' => 'Bearer '.$token,
                      ],
                  ]);
      $response = $client->request('POST', config('global.ecsite.url').'/api/addresses/create', [
                      'form_params'  => $data,
                  ]);
      

      But the response value is

       Client error: `POST https://shop.whatanaka.com/api/addresses/create` resulted in a `401 Unauthorized` response:
      {"error":"Unauthenticated"}
      

      What am I doing wrong? Could you help me, please?

      posted in General Discussion
      W
      William Hatanaka
    • RE: api - I can create a address ...

      Hello, @devansh-webkul
      But how can I do on Laravel?
      I developed another system in Laravel thar consume Bagisto API, so I need to create a address on Bagisto E-commerce system throghout this another system in Laravel .
      I am using Guzzle like this...

                 $response = $client->request('POST', config('global.ecsite.url').'/api/addresses/create', [
                      'form_params'  => [
                          'address1'=>[$member->address],
                          'city'=>$member->city,
                          'country'=>'JP',
                          'country_name'=>'Japan',
                          'phone'=>$member->fixed_phone,
                          'postcode'=>$member->zipcode,
                          'state'=>$member->prefecture,
                      ]
      

      and the response value is:

      'Client error: `POST https://shop.mysite.com/api/addresses/create` resulted in a `401 Unauthorized` response:
      {"error":"Unauthenticated"}
      ',
      

      Could you help me please?

      posted in General Discussion
      W
      William Hatanaka
    • RE: api - I can create a address ...

      @devansh-webkul
      It's worked! Tahnk you very much !!!

      posted in General Discussion
      W
      William Hatanaka
    • RE: [API] Can not get Get Customer’s Information using API

      Hello, @yomnademerdash
      Did you manage to solve your problem? If so, could you tell me how you managed to solve it? I have the same problem.

      posted in Bug Report
      W
      William Hatanaka
    • api - I can create a address ...

      I following the https://devdocs.bagisto.com/1.x/api/addresses.html#create-a-new-address example, but I no have success... For tests I am using the the Postman.
      The version of Bagisto is v1.1.0 (24th of March 2020)
      I can login adding the [?token=true] to [api/customer/login] .
      After that I try to create a address for this customer and the error 500 Internal Server Error occurs.
      I try to create mannally the address and read it by api using GET <host>/api/addresses and I can get it !!!
      But I can create and update...
      Somebody could help me please?

      ![alt text](fec6dfa7-68f6-4c21-964f-1dbeb56cb8f8-image.png image url)

      posted in General Discussion
      W
      William Hatanaka
    • RE: Bagisto Web Api - Customers Registration

      @vishalK ,
      Thank you very much!
      I will try!

      posted in General Discussion
      W
      William Hatanaka
    • RE: Bagisto Web Api - Customers Registration

      @vishalK,
      Thank you for your quick reply !
      But could you tell me where I can make this customization? Or rather, what is the source where I can do it? I am not very familiar with Bagisto yet, but I really need to do it. I chose Bagisto because of this api feature, but I didn't know I wouldn't be able to do this complete update on the customer profile.
      Thanks a lot.

      posted in General Discussion
      W
      William Hatanaka
    • Bagisto Web Api - Customers Registration

      Hello,
      I am using Bagisto v.1.1.2 and I am able to register customers in Bagistro through api-customer registration without problems.
      Besides the fields email, first_name, last_name, password, password_confirmation I also need to register the group to which this customer belongs.
      I tried to add the "group" field to the list of parameters with the corresponding "id" value but the registered user is still in the "general" group.
      Could you advise me how to do this?
      Thank you very much.

      posted in General Discussion
      W
      William Hatanaka