Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
Magic Website Factory
Magic Website Factory
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Indienet
  • Magic Website FactoryMagic Website Factory
  • Issues
  • #1

Closed
Open
Opened Apr 03, 2018 by Aral Balkan@aralOwner
  • Report abuse
Report abuse

Implement new API

All API calls require the passing of a secret that authenticates them. For the test server, this secret is hardcoded.

secret=ethical-design

## API versioning

The API endpoints should be versioned, starting with the current version at /v1. All locations, below, should be prefixed with the version identifier.

e.g., https://magicwebsitefactory.gent/v1/domain

Domain service

Location: /domain

GET

Check if the domain is available. Returns a JSON object with a boolean status.

Parameters

/domain/<domain>?secret=ethical-design

Where the following known values for domain returns the following responses:

Responses

  • available.gent: {"status": true}
  • unavailable.gent: {"status": false}
  • error.gent: triggers the 503 service unavailable error.

On error, the server should return a valid error message.

Valid errors:

  • 503: Service unavailable. The domain check/registration service is unavailable.

Site service

Location: /site

POST

Asks for the passed domain to be registered and for an Indie Site to be set up at it.

Parameters

  • domain=<domain>: the domain to register
  • callback=<callback-url>: the callback URL to inform when the domain is ready
  • secret=ethical-design

Responses

  • Registration request received and process successfully started: 201 Created
  • Domain not available: 409 Conflict
  • Domain registration service is unavailable: 503 Service Unavailable

Callback

On successful registration of the domain and creation of the Indie Site, the Magic Website Factory carries out a PATCH request to the callback URL passed in the Site service’s POST method with the following arguments:

PATCH

Location: <callback-url>/site/

Parameters

  • <callback-url>/site/<domain>: domain to update the status for
  • ?status=<code>: 201 = created, 409 = conflict (domain not available), 500 = internal server error (the site setup process failed and will not be retried)
  • &secret=ethical-design

Responses

The Magic Website Factory expects the following responses to its callback request:

  • 200 OK: Response successfully received
  • Error code (depending on error): callback failed. Log the error and queue the callback to be tried again (exponential falloff).
Edited Apr 03, 2018 by Aral Balkan
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
0
Labels
None
Assign labels
  • View project labels
Reference: indienet/magic-website-factory#1

Like this? Fund us! Your patronage helps keep us independent and going.