Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Get api with customer_id in url

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Get api with customer_id in url

    I have a panel card the has three input fields and one button. first_name, last_name, email. the button fires a xbasic function and sends the info to an api endpoint I receive back a person_id. This works however, the button also takes me to a new panel. in that new Panel card. I want to display the person's first_name with some text. For example, thanks Jason, we need to gather a little bit more information. the fields then ask for dob and address. the button on this panel card will submit to api endpoint that has the person_id that was captured in the previous panel card in the url. for example the endpoint is PATCH {{root}}/v0/customers/:person_id My issues is that I dont know how to send the person_id within the url. I have tried "+e.state.person_id+" that doesn't seem to work. does anyone have any ideas on the best way to display the name and submit the person_id in the url? thanks, Jo

    #2
    Hi Jo,

    The characteristics of APIs vary as much as the organizations that make them available.
    The API documentation is crucial to making them work.
    With that said, I often set a known working URL with placeholders : eg <personid> , and
    then replace that with the real data using strtran : eg apiURL = strtran(apiURL,"<personid>", [formatted data]) .
    The data must be formatted as required by the end point's documentation.

    Gregg
    https://paiza.io is a great site to test and share sql code

    Comment


      #3
      I appreciate the reply Gregg but I am not sure I understand. I want to execute a patch like this PATCH {{root}}/v0/customers/:person_id I already know the person_id as it came from a previous function result and I have it stored in sql table. I just dont know how to get that 25 character number to be inserted into this url {{root}}/v0/customers/:person_id - I apologize but I don't understand strtran

      Comment


        #4
        This works a lot easier when I have something real to work with, but lets assume the api has a url like "api.somedomain.com/v0/customers?personid=<personid>"
        Your code would be urlvariable = strtran(apiurl,"<personid>",[data from sql query]) .
        It might be a bit confusing, but that's because I'm making things up instead of using useful examples.
        https://documentation.alphasoftware....ran%20function
        Gregg
        https://paiza.io is a great site to test and share sql code

        Comment


          #5
          Originally posted by edufi View Post
          I want to execute a patch like this PATCH {{root}}/v0/customers/:person_id I already know the person_id as it came from a previous function result and I have it stored in sql table. I just dont know how to get that 25 character number to be inserted into this url {{root}}/v0/customers/:person_id
          if you are using xbasic you can add debug(1) to the code and inspect e. to check if person_id is available. :person_id is likely a placeholder so you also need to remove the : character
          https://appsbydesign.co.uk/

          Comment


            #6
            Originally posted by edufi View Post
            I have a panel card the has three input fields and one button. first_name, last_name, email. the button fires a xbasic function and sends the info to an api endpoint I receive back a person_id. This works however, the button also takes me to a new panel. in that new Panel card. I want to display the person's first_name with some text. For example, thanks Jason, we need to gather a little bit more information. the fields then ask for dob and address. the button on this panel card will submit to api endpoint that has the person_id that was captured in the previous panel card in the url. for example the endpoint is PATCH {{root}}/v0/customers/:person_id My issues is that I dont know how to send the person_id within the url. I have tried "+e.state.person_id+" that doesn't seem to work. does anyone have any ideas on the best way to display the name and submit the person_id in the url? thanks, Jo
            As Gregg said , the first thing you should do when you deal with API , is the API documentation .
            When you have it , it will make things easier to implement.

            Comment


              #7
              Hi all, thank you for the replies. I am not sure where I am miscommunicating but I apologize for it. I have the documentation. I am even listing out the API endpoint and what action I want to take with that endpoint. this is an update to a record. PATCH {{root}}/v0/customers/:person_id This is the endpoint exactly as it is in the documentation. The only thing that gets changed is, :person_id is replaced with characters when it's sent. for example PATCH {{root}}/v0/customers/24rte-234-df-3445r-234e When I send that in Postman along with my header and body information, it works. The person_id is created from a panel card previous to this step. The panel card triggers another api endpoint and retrieves the person_id as a response. I add that person_id to my SQL table. All I want to know is when I call the function to trigger this api endpoint (PATCH {{root}}/v0/customers/:person_id) how do I pull the person_id from my SQL table and add it to the endpoint?

              Comment


                #8
                Originally posted by edufi View Post
                how do I pull the person_id from my SQL table and add it to the endpoint?
                you could do an sql select to retrieve the info using the logged in user or similar to filter.
                check the documentation and samples in the forum.
                https://forum.alphasoftware.com/foru...-with-argument

                https://appsbydesign.co.uk/

                Comment


                  #9
                  I guess I’ve been doing a poor job of communicating as well. In order for me to have a chance at providing a useful response, it helps if I have access to the api documentation. You would be surprised at how often I find the answer in the details people thought were irrelevant.
                  Gregg
                  https://paiza.io is a great site to test and share sql code

                  Comment


                    #10
                    Thanks, Gregg I am happy to share the api docs. I am very grateful for any assistance. The customer's API reference is the main doc. https://dev.synctera.com/reference#customers
                    My first step is to create a customer prospect https://dev.synctera.com/reference/c...createCustomer I will use the Prospect value located under the 4 required fields. change from Active to prospect. Once I create a prospect (using a panel card with only the first, last name, email), I will receive person_id in response. I will then ask the user for more information in a different panel card and send that information as a PATCH with that person_id to completer the customer profile. https://dev.synctera.com/reference/c.../patchCustomer

                    Comment


                      #11
                      Now that I saw the documentation, it would be extremely helpful to see your code (please use sanitized data).
                      I believe I am specifically looking for the body section of the API. With a little luck, we'll get you on your way shortly.
                      Gregg
                      https://paiza.io is a great site to test and share sql code

                      Comment


                        #12
                        my freestyle examples are typically not as good as working with your code, but here goes.
                        I borrowed the example from the API's documentations.
                        I'm expecting that you are using http_fetch to work with the endpoint .
                        Ideally, your code has something resembling the code shown below.
                        I am willing to work with you (screenshare and/or phone call) if some of this is clear as mud.
                        I won't call myself an expert, but I have figured out the APIs for RingCentral, Square, and Sabeq
                        , working with users and their code (RingCentral was for myself).

                        Code:
                        apiSettings.body = <<%txt%
                        { "dob": "2000-01-01",
                        "email": "[email protected]",
                        "first_name": "Darren",
                        "last_name": "Shanahan",
                        "legal_address": { "address_line_1": "125 Mitchell Junctions",
                        "address_line_2": "Apt. 073",
                        "city": "North Orintown",
                        "country_code": "KN",
                        "default_address_flg": true,
                        "id": "<id from sql>",
                        "postal_code": "28620",
                        "state": "FL",
                        "type": "work" },
                        "metadata": {},
                        "middle_name": "c",
                        "phone_number": 19474678382,
                        "shipping_address": { "address_line_1": "125 Mitchell Junctions", "address_line_2": "Apt. 073", "city": "North Orintown", "country_code": "KN", "default_address_flg": true,
                        "id": "<id from sql>",
                        "postal_code": "28620", "state": "FL", "type": "work" },
                        "ssn": "384-94-4763", "status": "PROSPECT" }
                        %txt%
                        
                        apiSettings.body = strtran(apiSettings.body("<id from sql>",IDfromSQL)
                        apiResult = http_fetch(apiSettings)
                        2021-12-03_22-37-32.png
                        Gregg
                        https://paiza.io is a great site to test and share sql code

                        Comment


                          #13
                          Gregg I simply use the curl to xbasic genie but I think I see where you are going with strtran and http_fetch. I am out of the office but I am excited to work on this again Tuesday. Thanks for the info.

                          Comment


                            #14
                            Glad to help. I can do even better if you have a working curl statement.
                            Looking forward to hearing about your progress.
                            Gregg
                            https://paiza.io is a great site to test and share sql code

                            Comment


                              #15
                              Gregg my long weekend has afforded more thought into my overall application. This application will use the alpha security framework. When a customer lead hits the username and password landing page of the alpha security framework, they will use the create an account option to open a new account. This is where i see them entering their first, last name, email along with username and password. I eventually see email verification too. When they create the account i will send the three fields first, last name and email to the customer prospect endpoint. This endpoint will return the person_id.
                              Since they are a new customer they will be taken to the application panel to enter all of their individual information. Once their application is complete and approved then the next subsequent login on will take them to their home page and bypass the application.
                              from there all of the other endpoint requests will use their person_id. I would love to get your thoughts on this.-thanks

                              Comment

                              Working...
                              X