Last active
September 24, 2019 09:18
APIM CURL Commands for WSO2 Trilogy Medium
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@consumer-key = <Replace with Consumer Key> | |
@consumer-secret = <Replace with Consumer Secret> | |
@api-hostname = https://10.100.5.220:8244/dev-management/v1.0.0 | |
# Username & Password | |
@api-username = admin | |
@api-password = admin | |
@username = athiththan11 | |
### Token Endpoint | |
# @name tokenEndpoint | |
curl -k -d "grant_type=password&username={{api-username}}&password={{api-password}}&scope=default" \ | |
-H "Authorization: Basic <Replace with Base64Encode(ClientID:ClientSecret)>" \ | |
https://localhost:8244/token | |
@access-token = {{tokenEndpoint.response.body.access_token}} | |
@authorization = Bearer {{access-token}} | |
### Get Developer | |
# @name getDeveloperAPI | |
curl -k -X GET {{api-hostname}}/devs/{{username}} \ | |
-H "accept: application/json" \ | |
-H "Authorization: {{authorization}}" | |
### Get Repos of a Developer | |
# @name getReposAPI | |
curl -k -X GET {{api-hostname}}/devs/{{username}}/repos \ | |
-H "accept: application/json" \ | |
-H "Authorization: {{authorization}}" | |
### Delete a Developer | |
# @name deleteDeveloperAPI | |
curl -k -X DELETE {{api-hostname}}/devs/{{username}} \ | |
-H "accept: application/json" \ | |
-H "Authorization: {{authorization}}" | |
### Create a Developer | |
# @name addDeveloperAPI | |
curl -k -X POST {{api-hostname}}/devs \ | |
-d '{ "username": "athiththan11", "name": "Athiththan", "email": "athiththan11@test.com" }' \ | |
-H "Content-Type: application/json" \ | |
-H "accept: application/json" \ | |
-H "Authorization: {{authorization}}" | |
### Create a Repo | |
# @name addRepoAPI | |
curl -k -X POST {{api-hostname}}/repos \ | |
-d '{ "name": "repodews", "username": "athiththan11", "forks": 0 }' \ | |
-H "Content-Type: application/json" \ | |
-H "accept: application/json" \ | |
-H "Authorization: {{authorization}}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment