Remote Provider Service v1.0.0
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
API for the Remote Provider Service. Exposes healthchecks and supports communication with Git Providers.
Base URLs:
Terms of service Email: Blue Team Web: Blue Team License: Codacy. All rights reserved
organization
listOrganizations
Code samples
# You can also use wget
curl -X GET http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserId}/organizations \
-H 'Accept: application/json' \
-H 'token: string'
GET http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserId}/organizations HTTP/1.1
Host: rps.dev.codacy.org
Accept: application/json
token: string
var headers = {
'Accept':'application/json',
'token':'string'
};
$.ajax({
url: 'http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserId}/organizations',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json',
'token':'string'
};
fetch('http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserId}/organizations',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'token' => 'string'
}
result = RestClient.get 'http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserId}/organizations',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'token': 'string'
}
r = requests.get('http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserId}/organizations', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserId}/organizations");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"token": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserId}/organizations", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /{provider}/user/{remoteUserId}/organizations
Finds all organizations for remote user id of a specific provider
Finds all organizations for remote user id of a specific provider.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| provider | path | string | true | Git Provider |
| remoteUserId | path | string | true | Remote user identifier |
| token | header | string | false | Provider Token |
Example responses
Successful operation
[
{
"id": 1,
"name": "Codacy",
"avatar": "www.codacy.com",
"userId": "1",
"userRole": "Admin"
}
]
400 Response
{
"description": "string"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful operation | Inline |
| 400 | Bad Request | Bad Request | Error |
| 500 | Internal Server Error | Internal Server Error | Error |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | [RemoteOrganization] | false | none | none |
| » id | RemoteOrganizationIdentifier | true | none | none |
| » name | string | true | none | none |
| » avatar | string | true | none | none |
| » userId | string | true | none | none |
| » userRole | string | true | none | none |
listOrganizationMembers
Code samples
# You can also use wget
curl -X GET http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/members \
-H 'Accept: application/json' \
-H 'token: string'
GET http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/members HTTP/1.1
Host: rps.dev.codacy.org
Accept: application/json
token: string
var headers = {
'Accept':'application/json',
'token':'string'
};
$.ajax({
url: 'http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/members',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json',
'token':'string'
};
fetch('http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/members',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'token' => 'string'
}
result = RestClient.get 'http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/members',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'token': 'string'
}
r = requests.get('http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/members', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/members");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"token": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/members", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/members
Finds all members for remote organization name of a specific provider
Finds all members for remote organization name of a specific provider.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| provider | path | string | true | Git Provider |
| remoteOrgName | path | string | true | Remote organization name |
| remoteUserIdentifier | path | string | true | Remote user identifier |
| token | header | string | false | Provider Token |
Example responses
Successful operation
[
{
"id": 1,
"name": "Machado",
"avatar": "www.codacy.com"
}
]
400 Response
{
"description": "string"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful operation | Inline |
| 400 | Bad Request | Bad Request | Error |
| 500 | Internal Server Error | Internal Server Error | Error |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | [RemoteUser] | false | none | none |
| » id | RemoteUserIdentifier | true | none | none |
| » name | string | true | none | none |
| » avatar | string | true | none | none |
listOrganizationRepos
Code samples
# You can also use wget
curl -X GET http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/repos?page=1&size=1 \
-H 'Accept: application/json' \
-H 'token: string'
GET http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/repos?page=1&size=1 HTTP/1.1
Host: rps.dev.codacy.org
Accept: application/json
token: string
var headers = {
'Accept':'application/json',
'token':'string'
};
$.ajax({
url: 'http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/repos',
method: 'get',
data: '?page=1&size=1',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json',
'token':'string'
};
fetch('http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/repos?page=1&size=1',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'token' => 'string'
}
result = RestClient.get 'http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/repos',
params: {
'page' => 'integer(int32)',
'size' => 'integer(int32)'
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'token': 'string'
}
r = requests.get('http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/repos', params={
'page': '1', 'size': '1'
}, headers = headers)
print r.json()
URL obj = new URL("http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/repos?page=1&size=1");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"token": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/repos", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/repos
Finds all repos for remote organization name of a specific provider
Finds all repos for remote organization name of a specific provider.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| provider | path | string | true | Git Provider |
| remoteOrgName | path | string | true | Remote organization name |
| remoteUserIdentifier | path | string | true | Remote user identifier |
| page | query | integer(int32) | true | Page number |
| size | query | integer(int32) | true | Page size |
| repositoryName | query | string | false | Repository name to filter organization's project list |
| token | header | string | false | Provider Token |
Example responses
Successful operation
[
{
"id": 1,
"name": "Website",
"owner": "Codacy",
"isPrivate": true,
"permissions": {
"admin": true,
"push": true,
"pull": true
}
}
]
400 Response
{
"description": "string"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful operation | Inline |
| 400 | Bad Request | Bad Request | Error |
| 500 | Internal Server Error | Internal Server Error | Error |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | [RemoteRepository] | false | none | none |
| » id | RemoteRepositoryIdentifier | true | none | none |
| » name | string | true | none | none |
| » owner | string | true | none | none |
| » isPrivate | boolean | true | none | none |
| » url | string | true | none | none |
| » permission | RepositoryPermission | true | none | none |
| »» admin | boolean | true | none | none |
| »» push | boolean | true | none | none |
| »» pull | boolean | true | none | none |
| » updatedAt | string(date-time) | true | none | none |
getRepository
Code samples
# You can also use wget
curl -X GET http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/repo/{repositoryName} \
-H 'Accept: application/json' \
-H 'token: string'
GET http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/repo/{repositoryName} HTTP/1.1
Host: rps.dev.codacy.org
Accept: application/json
token: string
var headers = {
'Accept':'application/json',
'token':'string'
};
$.ajax({
url: 'http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/repo/{repositoryName}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json',
'token':'string'
};
fetch('http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/repo/{repositoryName}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'token' => 'string'
}
result = RestClient.get 'http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/repo/{repositoryName}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'token': 'string'
}
r = requests.get('http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/repo/{repositoryName}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/repo/{repositoryName}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"token": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/repo/{repositoryName}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/repo/{repositoryName}
Finds a specific repo for remote organization name and repository name of a specific provider
Finds a specific repo for remote organization name and repository name of a specific provider.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| provider | path | string | true | Git Provider |
| remoteOrgName | path | string | true | Remote organization name |
| remoteUserIdentifier | path | string | true | Remote user identifier |
| repositoryName | path | string | true | Project name to filter organization's project list |
| token | header | string | false | Provider Token |
Example responses
Successful operation
{
"id": 1,
"name": "Website",
"owner": "Codacy",
"isPrivate": true,
"permissions": {
"admin": true,
"push": true,
"pull": true
}
}
400 Response
{
"description": "string"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful operation | RemoteRepository |
| 400 | Bad Request | Bad Request | Error |
| 500 | Internal Server Error | Internal Server Error | Error |
listRepositoryMemberships
Code samples
# You can also use wget
curl -X GET http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/repo/{repositoryName}/memberships \
-H 'Accept: application/json' \
-H 'token: string'
GET http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/repo/{repositoryName}/memberships HTTP/1.1
Host: rps.dev.codacy.org
Accept: application/json
token: string
var headers = {
'Accept':'application/json',
'token':'string'
};
$.ajax({
url: 'http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/repo/{repositoryName}/memberships',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json',
'token':'string'
};
fetch('http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/repo/{repositoryName}/memberships',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'token' => 'string'
}
result = RestClient.get 'http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/repo/{repositoryName}/memberships',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'token': 'string'
}
r = requests.get('http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/repo/{repositoryName}/memberships', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/repo/{repositoryName}/memberships");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"token": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/repo/{repositoryName}/memberships", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /{provider}/user/{remoteUserIdentifier}/org/{remoteOrgName}/repo/{repositoryName}/memberships
List people that have access to a repository
List people that have access to a repository.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| provider | path | string | true | Git Provider |
| remoteOrgName | path | string | true | Remote organization name |
| remoteUserIdentifier | path | string | true | Remote user identifier |
| repositoryName | path | string | true | Project name to filter organization's project list |
| token | header | string | false | Provider Token |
Example responses
Successful operation
[
{
"id": 1
},
{
"id": 2
}
]
400 Response
{
"description": "string"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful operation | Inline |
| 400 | Bad Request | Bad Request | Error |
| 404 | Not Found | Not Found | Error |
| 500 | Internal Server Error | Internal Server Error | Error |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | [RemoteRepositoryMembership] | false | none | none |
| » userId | RemoteUserIdentifier | true | none | none |
listOrganizationsMemberships
Code samples
# You can also use wget
curl -X GET http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/organizations/memberships \
-H 'Accept: application/json' \
-H 'token: string'
GET http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/organizations/memberships HTTP/1.1
Host: rps.dev.codacy.org
Accept: application/json
token: string
var headers = {
'Accept':'application/json',
'token':'string'
};
$.ajax({
url: 'http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/organizations/memberships',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json',
'token':'string'
};
fetch('http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/organizations/memberships',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'token' => 'string'
}
result = RestClient.get 'http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/organizations/memberships',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'token': 'string'
}
r = requests.get('http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/organizations/memberships', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/organizations/memberships");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"token": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/organizations/memberships", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /{provider}/user/{remoteUserIdentifier}/organizations/memberships
Finds all membership status for the user's organizations
Finds all membership status for the user's organizations.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| provider | path | string | true | Git Provider |
| remoteUserIdentifier | path | string | true | Remote user identifier |
| token | header | string | false | Provider Token |
Example responses
Successful operation
[
{
"userId": 1,
"organizationId": 1,
"status": "active",
"role": "admin"
}
]
400 Response
{
"description": "string"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful operation | Inline |
| 400 | Bad Request | Bad Request | Error |
| 500 | Internal Server Error | Internal Server Error | Error |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | [RemoteOrganizationMembership] | false | none | none |
| » userId | RemoteUserIdentifier | true | none | none |
| » organizationId | RemoteOrganizationIdentifier | true | none | none |
| » role | string | true | none | none |
listOrganization
Code samples
# You can also use wget
curl -X GET http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/organization/{remoteOrgName} \
-H 'Accept: application/json' \
-H 'token: string'
GET http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/organization/{remoteOrgName} HTTP/1.1
Host: rps.dev.codacy.org
Accept: application/json
token: string
var headers = {
'Accept':'application/json',
'token':'string'
};
$.ajax({
url: 'http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/organization/{remoteOrgName}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json',
'token':'string'
};
fetch('http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/organization/{remoteOrgName}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'token' => 'string'
}
result = RestClient.get 'http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/organization/{remoteOrgName}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'token': 'string'
}
r = requests.get('http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/organization/{remoteOrgName}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/organization/{remoteOrgName}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"token": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://rps.dev.codacy.org/v1/{provider}/user/{remoteUserIdentifier}/organization/{remoteOrgName}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /{provider}/user/{remoteUserIdentifier}/organization/{remoteOrgName}
Finds information for a specific organization and membership for the user
Finds membership status for the user in a specific organization.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| provider | path | string | true | Git Provider |
| remoteOrgName | path | string | true | Remote organization name |
| remoteUserIdentifier | path | string | true | Remote user identifier |
| token | header | string | false | Provider Token |
Example responses
Successful operation
{
"id": 1,
"name": "Codacy",
"avatar": "www.codacy.com",
"userId": "1",
"userRole": "Admin"
}
400 Response
{
"description": "string"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful operation | RemoteOrganization |
| 400 | Bad Request | Bad Request | Error |
| 500 | Internal Server Error | Internal Server Error | Error |
cleanCache
Code samples
# You can also use wget
curl -X POST http://rps.dev.codacy.org/v1/cleanCache \
-H 'Accept: application/json' \
-H 'token: string'
POST http://rps.dev.codacy.org/v1/cleanCache HTTP/1.1
Host: rps.dev.codacy.org
Accept: application/json
token: string
var headers = {
'Accept':'application/json',
'token':'string'
};
$.ajax({
url: 'http://rps.dev.codacy.org/v1/cleanCache',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json',
'token':'string'
};
fetch('http://rps.dev.codacy.org/v1/cleanCache',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'token' => 'string'
}
result = RestClient.post 'http://rps.dev.codacy.org/v1/cleanCache',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'token': 'string'
}
r = requests.post('http://rps.dev.codacy.org/v1/cleanCache', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://rps.dev.codacy.org/v1/cleanCache");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"token": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "http://rps.dev.codacy.org/v1/cleanCache", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /cleanCache
Cleans all cache entries for a user token
Cleans all cache entries for a user token.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| token | header | string | true | Provider Token |
Example responses
400 Response
{
"description": "string"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful operation | None |
| 400 | Bad Request | Bad Request | Error |
| 500 | Internal Server Error | Internal Server Error | Error |
Schemas
RemoteOrganizationIdentifier
"string"
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | string | false | none | none |
RemoteUserIdentifier
"string"
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | string | false | none | none |
RemoteRepositoryIdentifier
"string"
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | string | false | none | none |
RemoteOrganization
{
"id": "string",
"name": "string",
"avatar": "string",
"userId": "string",
"userRole": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| id | RemoteOrganizationIdentifier | true | none | none |
| name | string | true | none | none |
| avatar | string | true | none | none |
| userId | string | true | none | none |
| userRole | string | true | none | none |
RemoteUser
{
"id": "string",
"name": "string",
"avatar": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| id | RemoteUserIdentifier | true | none | none |
| name | string | true | none | none |
| avatar | string | true | none | none |
RepositoryPermission
{
"admin": true,
"push": true,
"pull": true
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| admin | boolean | true | none | none |
| push | boolean | true | none | none |
| pull | boolean | true | none | none |
RemoteRepository
{
"id": "string",
"name": "string",
"owner": "string",
"isPrivate": true,
"url": "string",
"permission": {
"admin": true,
"push": true,
"pull": true
},
"updatedAt": "2019-10-22T10:06:29Z"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| id | RemoteRepositoryIdentifier | true | none | none |
| name | string | true | none | none |
| owner | string | true | none | none |
| isPrivate | boolean | true | none | none |
| url | string | true | none | none |
| permission | RepositoryPermission | true | none | none |
| updatedAt | string(date-time) | true | none | none |
RemoteOrganizationMembership
{
"userId": "string",
"organizationId": "string",
"role": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| userId | RemoteUserIdentifier | true | none | none |
| organizationId | RemoteOrganizationIdentifier | true | none | none |
| role | string | true | none | none |
RemoteRepositoryMembership
{
"userId": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| userId | RemoteUserIdentifier | true | none | none |
Error
{
"description": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| description | string | true | none | none |