Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature to allow REST calls to custom web scripts through the SDK #183

Closed
ohej opened this issue Jun 13, 2016 · 4 comments
Closed

Feature to allow REST calls to custom web scripts through the SDK #183

ohej opened this issue Jun 13, 2016 · 4 comments
Assignees
Milestone

Comments

@ohej
Copy link
Contributor

ohej commented Jun 13, 2016

Even though the v1 REST APIs will eventually be near "feature complete", there will always be partners who wish to create custom web scripts.

This should be supported by the SDK.

@magemello magemello added this to the 0.1 milestone Jun 13, 2016
@eromano
Copy link
Contributor

eromano commented Jun 23, 2016

@ohej we are talking about to make possible do get GET, POST, PUT and DELETE to this kind of custom services right ? https://wiki.alfresco.com/wiki/Web_Scripts

@eromano
Copy link
Contributor

eromano commented Jun 23, 2016

If the functionality is this one I need a machine with a web script inside in order to test the implementation I was thinking about to implement something like :
executeWebScriptGet(servicePath, scriptPath, scriptArgs)
executeWebScriptPost(servicePath, scriptPath, scriptArgs)
executeWebScriptPut(servicePath, scriptPath, scriptArgs)
executeWebScriptDelete(servicePath, scriptPath, scriptArgs)

That return a promise with the data if the call is ok or a reject error if there are errors

@DenysVuika
Copy link
Contributor

DenysVuika commented Jun 23, 2016

@eromano I would suggest putting http method to the httpMethod argument to have only 1 api:
executeWebScript(httpMethod, servicePath, scriptPath, scriptArgs)

@ohej
Copy link
Contributor Author

ohej commented Jun 27, 2016

For some reason I missed the notification from this one! Sorry.

Yes, we are talking about being able to make GET/POST/PUT/DELETE calls to the repository.

Rather than depending on custom web scripts for testing, I suggest we do the tests around the "v0" REST APIs which are web scripts based.

Go checkout /alfresco/service/index/all on any Alfresco repository and you'll see a list of all the web scripts based REST APIs.

Here are some examples where you can test GET / POST / DELETE in a flow around login:
POST
POST /alfresco/service/api/login
curl -H "Content-Type: application/json" -k -X POST -d '{"username": "admin", "password": "admin"}' https://api-explorer.alfresco.com/alfresco/service/api/login

GET
GET /alfresco/service/api/login?u=admin&pw=admin
curl "https://api-explorer.alfresco.com/alfresco/service/api/login?u=admin&pw=admin"

DELETE
DELETE /alfresco/service/api/login/ticket/{ticket} (save the ticket from the requests above)
curl -k -X DELETE https://api-explorer.alfresco.com/alfresco/service/api/login/ticket/{ticket_id_from_get_or_post_request} --user admin:admin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants