connectapi
connectapi copied to clipboard
Use public git APIs
/v1/content/GUID/repository
was added in the 2022.12 release, so if the server version is at least that new, we can use it instead of the unversioned applications
path.
This is also an opportunity to improve the UX. The various repo_
functions are awkwardly named, IMO.
Notes on the GET
resource:
Response
{
"repository": "https://github.com/username/repository",
"branch": "main",
"directory": ".",
"polling": false
}
- 200 OK with recorded repository information
Fields
- repository: Identifies the Git repository. An absolute HTTP or HTTPS URL without credentials, query, or fragment.
- branch: The Git branch to track.
- directory: The location within the repository containing the content to track.
- polling: Indicates if this Git location is periodically polled looking for updates.
Errors
- 401 Unauthorized - when the request is not authenticated
- 403 Forbidden - when the user is not a publisher
- 404 Not Found - when the user is a publisher, but the content does not exist
- 403 Forbidden - when the user is a publisher, does not have collaborator rights
- 404 Not Found - when no Git repository information is associated with this content