I am brand new to Genexus and I come over some basic tasks. Now I try to access and test external API-s. I have import API-s over Import OpenAPI process which build API folder and Model folder. I want to test simpe API-s ( list Merchants ) but I cant find the right way to do it. Can somebody help me with that?
TIA
Stane
After importing YAML a folder named API is created containing procedures (Genexus objects) that call each service imported.
So, you need to call the procedure that in turn calls the REST service.
Something like:
Merchanlist(Parameters)
Check this document for further information: https://wiki.genexus.com/commwiki/servlet/wiki?31864,OpenAPI%20import%20tool#Sample+consumer+code
Related
I created a website that accepts appointments online using wix booking. I already managed to export the appointments with all the details to JSON format.
I am trying to do the same to be able to create the appointments from an external app but for this I want to be able to first obtain getServiceAvailability() from wix-bookings API and I can't find a way to do it. I have tried in all the ways that I know and I do not get any results, I am not a programming expert and that is why I ask for help in this way, if someone who knows wix well and how to work with its API that could help me at least have one basis of how to do it. Thank you
If you want to get the availability information from an external service, you can create an HTTP function to expose that information.
The sample library: ms-identity-macOS-swift-objc
appears to make use of MSGraph without 'importing' an headers from MSGraph. The only import is 'MSAL'... I don't understand this. Does MSAL provide access to MSGraph with no further action. I need to read Mailbox settings and create new Contacts. Do I need to import MSGraph? Is there relevant documentation I should read?
Thanks for any thoughts here!
Steve
Here is what you are searching for - Microsoft Graph SDK for ObjC:
https://github.com/microsoftgraph/msgraph-sdk-objc
Each network call to Microsoft Graph needs to be authenticated. For that purpose, creation of an instance of MSHTTPClient takes an MSAuthenticationProvider protocol's instance as parameter.
You can create the MSAuthenticationProvider instance via two ways:
Using MSGraphMSALAuthProvider
This repo handles the authentication scenarios via MSAL - https://github.com/microsoftgraph/msgraph-sdk-objc-auth
By writing your own implmentation of MSAuthenticationProvider
What would be the simplest tool/editor (ideally for Mac) to run web API queries (Stateless RESTful web API) in a loop in order to store Json results in a file ?
Very simple basically, trying just to automate the following :
- a first call to get a list of IDs
- then for each each ID, doing a call to get a few values related to this ID. Values are returned in a Json file, I would like to store them in a file (csv or excel)
To test the queries, I've used "Advanced REST client" to set a request with my authentication information header and do a few API queries tests, it works well but now I basically want to create a script to get the whole set of data which is returned and save in a file. With the idea to run this script from time to time. You can't to that with "Advanced REST client", right?
Sorry it's not (yet!) a super advanced question but any help would be greatly appreciated.
You may try Postman - definitely works on (accursed) Mac
I'm currently building a API service that accepts Input in HTTP Requests, processes the information, uses a template engine (Currently Jade) to parse the Template files and then outputs in either HTML, PDF or a Image.
I would like to have this service not be bound to a Database, as I don't see a need for it. The service has one goal, accept input and output the result in the desired format.
Currently I can't decide on how to store and read my templates, it's a new world without a database....
Do I store them in a folder such as "templates" which I read each time I want a list of templates ? But have no idea how and if file locks will cause problems ?
Any suggestions ?
Have a look at Express.js it will allow you to set up a project with a good default directory structure. By default it stores Jade templates in 'views'. There will be no problems with file locking.
One other thing I would do is separate the API service from the view rendering. At the moment I use restify for pure REST services it is specifically geared toward that use case. So the workflow would roughly look as follows
'views' folder <--> Jade templates <--> Express <--> JSON data <--> REST API
I am doing my first baby steps with Rails (version 3) now. I'd like to create a simple app catching data from the twitter/instagram/ API. Thankfully there are already gems doing the heavy lifting with connecting to the services, providing the data. Now I wonder what the best-practice is to add this functionality to Rails correctly.
My feeling is the best way is to create a new non-DB Model for each service I want to include and create some scopes, which I will then use in the controller. The scope definition includes the functional code, instantiating and using the twitter/instagram gems to get the web service's data.
Is this model/scope approach right or did I miss something?
In future I might need to cache all the fetched data to handle common API request limitations. Is there any good approach for this?
I'd appreciate your thoughts or examples/resources on this topic.
I think in this situation a standard class would be ok e.g.
class TwitterImport
def get_tweets
# Download tweets
...
# Create tweets
Tweet.create(.....
end
end
I created something similar recently. I created a folder called scripts in my app directory and stuck a class in there called import.rb. Because this file lives within the app directory it automatically has access to the Rails goodness i.e. existing Models etc.
I then set it up as a rails runner script, you run it via teh console from your app's root directory:
rails runner -e development TwitterImport.get_tweets