Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Customer API giving different response

    Knowledge Base
    3
    12
    1038
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      Ashishaxat last edited by

      Hi @shivam-webkul

      i guess there is same problem in params too , i tried every tabs in post to send data

      paramscustomerregister.png

      1 Reply Last reply Reply Quote 0
      • A
        Ashishaxat last edited by

        Shivam i have checked i guess there is problem in validation of a request
        if i give right credentials with proper password 6digit and unique emailID then api works, if i try to register with emailID which my DB already exist , and password is less than 6 digit then this problem comes

        i have updated the code in
        packages/Webkul/API/Http/Controllers/Shop/CustomerController.php
        check this out

        e7ce4b6c-7176-4129-bbc3-b272af38de92-image.png

        1 Reply Last reply Reply Quote 0
        • S
          shivam-webkul last edited by

          Hi @Ashishaxat ,

          Yes when You create the customer through api request you need to follow the validation rules as well like email must be in valid form and password should be 6 character long, then if you don't follow validation rule it return the error message in response.

          Thanks

          1 Reply Last reply Reply Quote 0
          • A
            Ashishaxat last edited by

            @shivam-webkul

            customers get api giving same html response,

            0676f826-09fa-4e5f-86f0-782edb323301-image.png

            S 1 Reply Last reply Reply Quote 0
            • A
              Ashishaxat last edited by

              same is with add to cart api as well

              i guess api should json response , why its showing some html data ?

              7332edb7-f1b8-4e28-99d3-5939c7d9507e-image.png

              S 1 Reply Last reply Reply Quote 0
              • E
                eolykab last edited by

                I am also concerned with the above. I have been testing this but API is not responding with correct error messages. So making difficult for any integrations.

                1 Reply Last reply Reply Quote 0
                • S
                  shivam-webkul @Ashishaxat last edited by shivam-webkul

                  @Ashishaxat ,
                  Yes @Ashishaxat i got your issue but you can't access the customer listing without login first you need to login through customer/login api then you can access those api.

                  Thnaks

                  1 Reply Last reply Reply Quote 0
                  • S
                    shivam-webkul @Ashishaxat last edited by

                    @Ashishaxat ,

                    Here you have to choose the product variant like if you want to add simple product in cart then you only need to pass only product id but when you want to add configurable product in cart then you need to pass the product_id as well as product variant.

                    Thanks

                    1 Reply Last reply Reply Quote 0
                    • A
                      Ashishaxat last edited by

                      Thanks @shivam-webkul and noted

                      how API will check whether customer is logged In ? as u can see response of login api , there is no token in response

                      1994b457-5830-4ebc-8565-f65783289d65-image.png

                      1 Reply Last reply Reply Quote 0
                      • S
                        shivam-webkul last edited by

                        @Ashishaxat ,

                        You can also get token of logged in customer

                        please have a look : https://forums.bagisto.com/topic/149/i-need-to-deliver-the-api-token-from-the-json-response-not-the-header

                        let me know if you still found any issue regarding this.

                        Thanks

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post