Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

HTTP Frameworks setup - resource manager

Going by the resultant output from the /api 'authorization' . Do all APIs you create have to be registered here?
Not quite sure I get the meaning of/How used:

Resource ID
Property

Comments

  • Yes, you should use the HTTP Framework Setup utility to identify resources. This utility will then auto-generate (if you so desire) your API code template.

    A resource ID is a unique identifier to a resource. Hence, if your resource is "customer" then a resource ID would be something like "1234".

    The endpoint of a resource would look like:

    api\customer

    The endpoint of a resource ID would look like:

    api\customer\1234

    A property is just a way to requesting a specific attribute (aka property) related to a resource. These aren't used very often. For the sake of illustration, let's say you wanted the provide an endpoint to the name of the customer. The endpoint of the property would look like:

    api\customer\1234\name
  • Cool, thank you
  • Not sure if I am miising something here:

    I have:


    in postman I do http://localhost/api I see JSON returned as below. I was expecting to see my newly added 'resource' thisisatest.

    { "_links": { "self": { "href": "http://localhost/api" }, "webaccounts": { "href": "http://localhost/api/webaccounts", "title": "Web Accounts" }, "contacts": { "templated": true, "href": "http://localhost/api/contacts{?first_name,last_name,state}", "title": "Contacts" }, "version": { "href": "http://localhost/api/version", "title": "API Version" }, "ping": { "href": "http://localhost/api/ping", "title": "Ping Test API" }, "oauth": { "href": "http://localhost/api/oauth", "title": "OpenAuthorization" } }, "_forms": { "resetPassword": { "method": "PATCH", "action": "http://localhost/api/webaccounts/test/password", "title": "Reset Password", "fields": { "value": { "default": "", "required": true, "visible": true } } } } }
  • Sorry, maybe I need to read more. Tell me where there is information on all this area.

    ..where is "_forms" coming from?

  • Did you actually click the Apply button to save the resource configuration?

    The _forms content is being generated by the entry point API. You can read about it in the how do I add hypermedia controls to a resource? article.
  • @BarryStevens

    The Voodoo magic of caching never seems to work the way I want/expect so I always found it good practice to restart the Windows Service when making pretty much any change to endpoints....

  • edited March 2022
    >>Did you actually click the Apply button to save the resource configuration?

    Yes and assume so as i would not be able to recall the info, I assume apply is a save as well.
    Sorry, just pursing this as I know this version is sort of new and just letting you know in case it is a bug.
  • 'thisisatest' is now appearing - after I recompiled HTTP_Resource_Manager_Services as I put a debug in, to tryand follow what happens...will never do that again LOL
  • It must be a cache issue somewhere as I removed it and it was still showing when 'send' again in postman.

    So, I think we may as well close the issue.
  • I think you are correct. It had been awhile since I looked at this code. We do have built-in caching in the HTTP_Resource_Manager_Services module. This is managed by this equate:

    Equ CacheTTL$ to 300 ; // Allow cached data to only be fresh for 5 minutes.
  • edited March 2022
    BarryStevens

    Like I said, I restart the service (or rather a debug mode command). I have a hotkey to trigger a window's .cmd file after any endpoint changes. This kils and and restarts the debug engine. Only takes few seconds when you get used to it.
    basically this:
    REM Don't forget to stop the Window's OEngineServer Service before debugging and restart it when finished. REM Kill any previous sessions taskkill /fi "WINDOWTITLE eq OEngineServer" REM Delay a few seconds for the kill to finish ping localhost REM Set the title of this window so we can find it. This should be unique. TITLE OEngineServer REM REM Get the date and time REM For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b) For /f "tokens=1-2 delims=/:" %%a in ('time /t') do (set mytime=%%a%%b) CD /D C:\OPTO\OPTO REM #Java -jar OESocketServer.jar -l eserver.cfg -d 3 > "oesocketserver_debug_test_%mydate%_%mytime%.txt" Java -jar OESocketServer.jar -l eserver.cfg -d 3 REM Use this if you need to see why the console closed REM pause

  • @Opto_Will, that looks cool. Have to have a go.
Sign In or Register to comment.